Method Length : Int () Property
Returns the number of characters contained in the string.
Impressum, Datenschutzerklärung
The String type is a fundamental cerberus type used to represent sequences of characters. More...
Properties | |
---|---|
Length : Int () |
Returns the number of characters contained in the string. |
Methods | |
---|---|
Compare : Int ( str:String ) |
Compares two strings. |
Contains : Bool ( str:String ) |
Returns true if the string contains str, else false. |
EndsWith : Bool ( str:String ) |
Returns true if this string ends with str, else false. |
Find : Int ( str:String, start:Int=0 ) |
Returns the offset of the first occurrence of str within this string, starting at the specified start offset. |
FindLast : Int ( str:String ) |
Returns the offset of the last occurrence of str within this string. |
FindLast : Int ( str:String, start:Int ) |
Returns the offset of the last occurrence of str within this string, starting at the optional offset specified by start. |
Join : String ( pieces:String[] ) |
Creates a single string by joining together each element of pieces, using the current string as a separator. |
Replace : String ( findStr:String, replaceStr:String ) |
Replaces all occurrences of findStr with replaceStr and returns the result. |
Split : String[] ( separator:String ) |
Splits this string into an array of pieces, using the separator string to delimit each piece. |
StartsWith : Bool ( str:String ) |
Returns true if the string starts with str, else false. |
ToChars : Int[] () |
Converts string to an array of character codes. |
ToLower : String () |
Converts the string to lowercase and returns the result. |
ToUpper : String () |
Converts the string to uppercase and returns the result. |
Trim : String () |
Removes any leading and trailing whitespace from the string and returns the result. |
Functions | |
---|---|
FromChar : String ( charCode:Int ) |
Creates and returns a string of length 1 containing the character code specified by charCode. |
FromChars : String ( charCodes:Int[] ) |
Creates and returns a string containing the character codes in the specified charCode array. |
The String type is a fundamental cerberus type used to represent sequences of characters.
Please see the Types section of the cerberus language reference for more information on the string type.
Method Length : Int () Property
Returns the number of characters contained in the string.
Method Compare : Int ( str:String )
Compares two strings. Returns a value <0 if this string is less than str, a value >0 if this string is greater than str, or 0 if the strings are equal.
Parametersstr - string to compare this string with.
Method Contains : Bool ( str:String )
Returns true if the string contains str, else false.
Parametersstr - string to check for.
Method EndsWith : Bool ( str:String )
Returns true if this string ends with str, else false.
Parametersstr - string to check for.
Method Find : Int ( str:String, start:Int=0 )
Returns the offset of the first occurrence of str within this string, starting at the specified start offset.
Returns -1 if str is not found.
Parametersstr - string to find.
start - offset to start search at.
Method FindLast : Int ( str:String )
Returns the offset of the last occurrence of str within this string.
Returns -1 if str is not found.
Parametersstr - string to search for.
start - offset to start search.
Method FindLast : Int ( str:String, start:Int )
Returns the offset of the last occurrence of str within this string, starting at the optional offset specified by start.
Returns -1 if str is not found.
Parametersstr - string to search for.
start - offset to start search.
Method Join : String ( pieces:String[] )
Creates a single string by joining together each element of pieces, using the current string as a separator.
Parameterspieces - An array of string to be joined.
Method Replace : String ( findStr:String, replaceStr:String )
Replaces all occurrences of findStr with replaceStr and returns the result.
ParametersfindStr - string to search for.
replaceStr - string to replace with.
Method Split : String[] ( separator:String )
Splits this string into an array of pieces, using the separator string to delimit each piece.
Parametersseparator - string to use to separate pieces.
Method StartsWith : Bool ( str:String )
Returns true if the string starts with str, else false.
Parametersstr - string to check for.
Method ToChars : Int[] ()
Converts string to an array of character codes.
Method ToLower : String ()
Converts the string to lowercase and returns the result.
See alsoMethod ToUpper : String ()
Converts the string to uppercase and returns the result.
See alsoMethod Trim : String ()
Removes any leading and trailing whitespace from the string and returns the result.
Function FromChar : String ( charCode:Int )
Creates and returns a string of length 1 containing the character code specified by charCode.
ParameterscharCode - character code to convert to a string.
Function FromChars : String ( charCodes:Int[] )
Creates and returns a string containing the character codes in the specified charCode array.
ParameterscharCodes - array of character codes.