g.js — graphical objects for JavaScript

String

Working with text

Creating strings

string — Create a simple string

import — Import text from a TXT file

Querying / lookup

stringLength — Give the length of the string

wordCount — Count the number of words in the string

characterAt — Take the character at the given index

contains — Check if the string contains the given text

startsWith / endsWith — Check if the string starts / ends with the given text

equal — Check if two strings are equal

Combining

concatenate — Combine multiple strings

Splitting

split — Split the string into substrings

toCharacters — Split the string into individual characters

Manipulating

stringReplace — Replace all occurrences of the text

substring — Take a portion of the string

trim — Remove spaces from the beginning / end

toLowerCase / toUpperCase / toTitleCase — Convert strings to upper- or lowercase