class StringExtensions
package markov.util
Extension methods for strings.
Static methods
staticinline capitalize (str:String):String
Creates a capitalized version of a string.
Parameters:
str | The string to capitalize. |
---|
Returns:
A capitalized copy of the string.
staticinline capitalizeWords (str:String):String
Capitalize the first letter of every word (separated by spaces) in the string.
Parameters:
str | The string containing words to capitalize. |
---|
staticinline contains (str:String, substr:String):Bool
Searches a string for a substring.
Parameters:
str | The string to search. |
---|---|
substr | The substring to check for. |
Returns:
True if the string contains the substring, false if not.
staticinline lowercase (str:String):String
Creates a lowercased version of a string.
Parameters:
str | The string to lowercase. |
---|
Returns:
A lowercased copy of the string.
staticinline lowercaseWords (str:String):String
Lower cases the first letter of every word (separated by spaces) in the string.
Parameters:
str | The string containing words to lower case. |
---|
staticinline repeat (str:String, times:Int):String
Repeats the given string the specified number of times i.e. repeat("foo", 3) => "foofoofoo".
Parameters:
str | The string to repeat. |
---|---|
times | The number of times to repeat the string. |
Returns:
The repeated string.
staticinline reverse (str:String):String
Creates a reversed copy of the given string.
Parameters:
str | The string to copy. |
---|
Returns:
A reversed copy of the given string.