String Utils
toSentence
Signature: toSentence(str: string)
Convert a string to a sentence.
Examples:
Expression
toSentence("this is a sentence")
Expression
toSentence("test")
toTitle
Signature: toTitle(str: string)
Convert a string to a title.
Examples:
Expression
toTitle("this is a title")
Expression
toTitle("test")
formatDate
Signature: formatDate(dateStr: string, format: string)
Generate a formatted date string. Check out date-and-time to see the supported format string.
Examples:
Expression
// publishedAt = "2022-01-01T00:00:00Z"
formatDate(publishedAt, "YYYY-MM-DD")
Table of Contents