STAY IN TOUCH

and receive our newsletter to get the latest news and tips.


String

A string is an immutable collection of characters that represent a piece of text.
  • you can declare a string literal using the "abc" button the keyboard. The content of a string literal is automatically escaped.
var s := "this is a string literal\nanother line."
  • strings can be concatenated using the || operator
s := "hello ""world"
  • you can access the number of characters and each individual characters
var count := s → count
var first char := s → at(0)
  • parse the string to various other data types
var x := s → to number
var c := s → to color
var d := s → to datetime
  • a string can be split in parts
var strings := s → split(",")
  • run regular expressions
var b := s → is match regex("bb|[^b]{2}")
s := s → replace regex("<[^>]+>", "--")
...
function (String) → at(index : Number) returns String
Gets the character at a specified index. Returns invalid if out of bounds.
function (String) → code at(index : Number) returns Number
Gets the charecter unicode value at a given index. Returns NaN if out of bounds
function (String) → compare(other : String) returns Number
Compares two pieces of text
function (String) → concat(other : String) returns String
Concatenates two pieces of text
function (String) → &#X2225;(other : String) returns String
Concatenates two pieces of text
function (String) → contains(value : String) returns Boolean
Returns a value indicating if the second string is contained
function (String) → copy to clipboard
Stores text in the clipboard
function (String) → count returns Number
Returns the number of characters
function (String) → ends with(value : String) returns Boolean
Determines whether the ending matches the specified string
function (String) → equals(other : String) returns Boolean
Checks if two strings are the same
function (String) → index of(value : String, start : Number) returns Number
Returns the index of the first occurence if found starting at a given position
function (String) → insert(start : Number, value : String) returns String
Inserts a string at a given position
function (String) → is empty returns Boolean
Indicates if the string is empty
function (String) → is invalid returns Boolean
Returns true if the current instance is useless
function (String) → is match regex(pattern : String) returns Boolean
Indicates if the string matches a regular expression
function (String) → last index of(value : String, start : Number) returns Number
Returns the index of the last occurence if found starting at a given position
function (String) → match(pattern : String) returns Collection of String
Gets the groups from the matching the regex expression (pattern). Returns an empty collection if no matches.
function (String) → matches(pattern : String) returns Collection of String
Gets the strings matching the regex expression (pattern)
function (String) → post to wall
Displays string on the wall
function (String) → remove(start : Number) returns String
Returns the string with characters removed starting at a given index
function (String) → replace(old : String, new : String) returns String
Returns a given string with a replacement
function (String) → replace regex(pattern : String, replace : String) returns String
Replace every match of the regex according to the replacement string
function (String) → replace regex with converter(pattern : String, replace : String Converter from Collection of String) returns String
Run replacer on every match of the regex
function (String) → share(network : String)
Shares the string (email, sms, facebook, social or '' to pick from a list)
function (String) → split(separator : String) returns Collection of String
Returns a string collection that contains the substrings in this string that are delimited by elements of a specified string.
function (String) → starts with(value : String) returns Boolean
Determines whether the beginning matches the specified string
function (String) → substring(start : Number, length : Number) returns String
Returns a substring given a start index and a length
function (String) → to boolean returns Boolean
Parses the string as a boolean
function (String) → to character code returns Number
Converts the first character into the character code number (unicode)
function (String) → to color returns Color
Parses the string as a color.
function (String) → to datetime returns DateTime
Parses the string as a date and time.
function (String) → to json returns Json Object
Converts the value into a json data structure.
function (String) → to location returns Location
Parses the string as a geo coordinate.
function (String) → to lower case returns String
Returns a copy of this string converted to lowercase, using the casing rules of the current culture.
function (String) → to number returns Number
Parses the string as a number
function (String) → to time returns Number
Parses the string as a time (12:30:12) and returns the number of seconds.
function (String) → to upper case returns String
Returns a copy of this string converted to uppercase, using the casing rules of the current culture.
function (String) → trim(chars : String) returns String
Removes all leading and trailing occurrences of a set of characters specified in a string from the current string.
function (String) → trim end(chars : String) returns String
Removes all trailing occurrences of a set of characters specified in a string from the current string.
function (String) → trim overflow(lim : Number) returns String
Trims the string at the given length and adds ... if necessary
function (String) → trim start(chars : String) returns String
Removes all leading occurrences of a set of characters specified in a string from the current string.