[back to index]

Library Reference (v 0.12.0)

S

Helpful string manipulation functions.
S.uppercase(currentstring:String):String
Returns an uppercase version of currentstring.
S.lowercase(currentstring:String):String
Returns an lowercase version of the string.
S.split(currentstring:String, delimiter:String):String
Splits a string into an array, divided by a given delimiter character (e.g. ",")
S.removefromstring(fullstring:String, substring:String):String
Removes substring from the fullstring.
S.isinstring(fullstring:String, stringtocheck:String):Bool
Returns true if the given stringtocheck is in the given fullstring.
S.positioninstring(fullstring:String, substring:String, start:Int = 0):String
Return the position of a substring in a given string. -1 if not found.
S.letterat(currentstring:String, position:Int = 0):String
Return character at given position
S.mid(currentstring:String, start:Int = 0, length:Int = 1):String
Return characters from the middle of a string.
S.left(currentstring:String, length:Int = 1):String
Return some characters from the left side of a string. (To remove characters from the start of a string instead, see S.removefromleft().)
S.right(currentstring:String, length:Int = 1):String
Return some characters from the right side of a string. (To remove characters from the end of a string instead, see S.removefromright().)
S.removefromleft(currentstring:String, length:Int = 1):String
Take N characters from the left of a string and return the original string without those characters. (To get the leftmost characters of a string, use S.left() instead.).
S.removefromright(currentstring:String, length:Int = 1):String
Take N characters from the right of a string and return the original string without those characters. (To get the rightmost characters of a string, use S.right() instead.).
S.reversetext(currentstring:String):String
Reverse a string.
S.replacechar(currentstring:String, ch:String = "|", ch2:String = ""):String
Given a string currentstring, replace all occurances of string ch with ch2. Useful to remove characters.
S.getroot(currentstring:String, ch:String):String
Given a string currentstring, return everything before the first occurance of the "ch" character
S.getbranch(currentstring:String, ch:String):String
Given a string currentstring, return everything after the FIRST occurance of the "ch" character
S.getlastbranch(currentstring:String, ch:String):String
Given a string currentstring, return everything after the LAST occurance of the "ch" character
S.getbetweenbrackets(currentstring:String):String
Given a string currentstring, return everything between the first and the last bracket ().
S.trimspaces(currentstring:String):String
Given a string currentstring, return a string without spaces around it.
S.isnumber(currentstring:String):String
True if string currentstring is some kind of number; false if it's something else.