Skip to main content

Text

" "​

Contains a text string.

This string can contain any characters (letters, numbers, or other special characters). On BlockySite, it will be considered a Text object.

join​

Appends all of the inputs to make a single string. If no inputs, then it returns an empty string.

length​

Returns the number of characters including spaces in the string. This is the length of the given text string.

is empty​

Returns whether or not the string contains any characters (including spaces). When the string length is 0, returns true otherwise it returns false.

is string?​

Returns true if the input is a string.

compare texts <> =​

Returns whether or not the first string is lexicographically <, >, or = the second string depending on which dropdown is selected.

A string a considered lexicographically greater than another if it is alphabetically greater than the other string. Essentially, it would come after it in the dictionary. All uppercase letters are considered smaller or to occur before lowercase letters. cat would be > Cat.

trim​

Removes any spaces leading or trailing the input string and returns the result.

upcase​

Returns a copy of its text string argument converted to all upper-case

downcase​

Returns a copy of its text string argument converted to all lowercase

starts at​

Returns the character position where the first character of the piece first appears in text, or 0 if not present. For example, the location of ana in havana banana is 4.

contains​

Returns true if piece appears in text; otherwise, returns false.

split​

split text

Divides text into pieces using at as the dividing points and produces a list of the results. Splitting one, two, three, four at,(comma) returns the list one two three four. Splitting one-potato,two-potato,three-potato, four at-potato*, returns the list one two three four*.

split at spaces​

Divides the given text at any occurrence of space, producing a list of the pieces.

segment​

Extracts part of the text starting at the start position and continuing for length characters.

replace all​

Returns a new text string obtained by replacing all occurrences of the substring with the replacement.

Replace all with She loves eating. She loves writing. She loves coding as the text, She as the segment, and Hannah as the replacement would result in Hannah loves eating. Hannah loves writing. Hannah loves coding.

reverse​

reverse

Reverse the given text.