Skip to main content

text

Contains functions that modify strings of text

Methods

replaceNewlineForHtml

pb.text.replaceNewlineForHtml(text)

Replaces newlines with linebreak HTML tags.

Returns: string - The modified string.

ParamTypeDescription
textstringThe string to modify.

replaceWhitespaceForHtml

pb.text.replaceWhitespaceForHtml(text)

Formats tabs and spaces into HTML that will display as intended.

Returns: string - The modified string.

ParamTypeDescription
textstringThe 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.

ParamTypeDescription
textstringThe string to modify.

capitalizeText

pb.text.capitalizeText(text)

Capitalizes the first character of a string.

Returns: string - The capitalized string.

ParamTypeDescription
textstringThe string to capitalize.

reverseText

pb.text.reverseText(text)

Reverses the contents of a string.

Returns: string - The reversed string.

ParamTypeDescription
textstringThe string to reverse.

escapeHtml

pb.text.escapeHtml(text)

Replaces the following characters with their HTML entity counterparts: &, <, >, ", '.

Returns: string - The modified string.

ParamTypeDescription
textstringThe string to modify.

replaceSpaceWithUnderscore

pb.text.replaceSpaceWithUnderscore(text)

Replaces the space characters with underscore characters.

Returns: string - The modified string.

ParamTypeDescription
textstringThe string to modify.

removeFileExtension

pb.text.removeFileExtension(text)

Removes the file extension section of a string.

Returns: string - The modified string.

ParamTypeDescription
textstringThe string to modify.