String
The String
object is the base class for all string operations in HISE.
const var s = "string";
Console.print(s.capitalize()); // String
Console.print("string".toUpperCase()); // STRING
Class methods
capitalize
Converts a string to start case (first letter of every word is uppercase). Edit on GitHub
String.capitalize()
charAt
Returns the character at the given index. Edit on GitHub
String.charAt(int index)
charCodeAt
Returns the character at the given position as ASCII number. Edit on GitHub
String.charCodeAt(var index)
concat
Joins two or more strings, and returns a new joined strings. Edit on GitHub
String.concat(var stringlist)
contains
Checks if the string contains the given substring. Edit on GitHub
String.contains(String otherString)
decrypt
Decrypt a string from Blowfish encryption. Edit on GitHub
String.decrypt(var key)
encrypt
Encrypt a string using Blowfish encryption. Edit on GitHub
String.encrypt(var key)
getIntValue
Attempts to parse the string as integer number. Edit on GitHub
String.getIntValue()
getTrailingIntValue
Attempts to parse a integer number at the end of the string. Edit on GitHub
String.getTrailingIntValue()
hash
Creates a unique hash from the string. Edit on GitHub
String.hash()
indexOf
Returns the position of the first found occurrence of a specified value in a string. Edit on GitHub
String.indexOf(var substring)
lastIndexOf
Returns the position of the last found occurrence of a specified value in a string. Edit on GitHub
String.lastIndexOf(var substring)
replace
Returns a copy of the string and replaces all occurences of a
with b
. Edit on GitHub
String.replace(var substringToLookFor, var replacement)
split
Splits the string into an array with the given separator. Edit on GitHub
String.split(var separatorString)
splitCamelCase
Splits the string at uppercase characters (so MyValue becomes ["My", "Value"]. Edit on GitHub
String.splitCamelCase()
substring
Returns the substring in the given range. Edit on GitHub
String.substring(int startIndex, int endIndex)
toLowerCase
Converts a string to lowercase letters. Edit on GitHub
String.toLowerCase()
toUpperCase
Converts a string to uppercase letters. Edit on GitHub
String.toUpperCase()
trim
Returns a copy of this string with any whitespace characters removed from the start and end. Edit on GitHub
String.trim()