text
Contains functions that modify strings of text
Methods
- replaceNewlineForHtml
- replaceWhitespaceForHtml
- convertTextForHtml
- capitalizeText
- reverseText
- escapeHtml
- replaceSpaceWithUnderscore
- removeFileExtension
replaceNewlineForHtml
pb.text.replaceNewlineForHtml(text)
Replaces newlines with linebreak HTML tags.
Returns: string
- The modified string.
Param | Type | Description |
---|---|---|
text | string | The string to modify. |
replaceWhitespaceForHtml
pb.text.replaceWhitespaceForHtml(text)
Formats tabs and spaces into HTML that will display as intended.
Returns: string
- The modified string.
Param | Type | Description |
---|---|---|
text | string | The string to modify. |
convertTextForHtml
pb.text.convertTextForHtml(text)
Replaces tabs, spaces, &, <, >, ", and ' with their HTML entity counterparts and newlines with linebreak HTML tags.
Returns: string
- The modified string.
Param | Type | Description |
---|---|---|
text | string | The string to modify. |
capitalizeText
pb.text.capitalizeText(text)
Capitalizes the first character of a string.
Returns: string
- The capitalized string.
Param | Type | Description |
---|---|---|
text | string | The string to capitalize. |
reverseText
pb.text.reverseText(text)
Reverses the contents of a string.
Returns: string
- The reversed string.
Param | Type | Description |
---|---|---|
text | string | The string to reverse. |
escapeHtml
pb.text.escapeHtml(text)
Replaces the following characters with their HTML entity counterparts: &, <, >, ", '.
Returns: string
- The modified string.
Param | Type | Description |
---|---|---|
text | string | The string to modify. |
replaceSpaceWithUnderscore
pb.text.replaceSpaceWithUnderscore(text)
Replaces the space characters with underscore characters.
Returns: string
- The modified string.
Param | Type | Description |
---|---|---|
text | string | The string to modify. |
removeFileExtension
pb.text.removeFileExtension(text)
Removes the file extension section of a string.
Returns: string
- The modified string.
Param | Type | Description |
---|---|---|
text | string | The string to modify. |