RString extension
Properties
capitalize
→ String
Uppercase first letter inside each word in string
Example: your name => Your Name
no setter
capitalizeFirst
→ String
Uppercase first letter inside string and let the others lowercase
Example: your name => Your name
no setter
firstOrEmpty
→ String
Returns last symbol of string or empty string if this
is null or empty
no setter
firstOrNull
→ String ?
return the first character
return null
if isEmpty
no setter
isPalindrome
→ bool
Checks if string is Palindrome.
no setter
lastOrEmpty
→ String
Returns last symbol of string or empty string if this
is null or empty
no setter
lastOrNull
→ String ?
return the last character
return null
if isEmpty
no setter
linesCount
→ int
return string lines count
no setter
reversed
→ String
Reverse a string
no setter
Methods
anyChar (bool predicate (String element ) )
→ bool
Returns true
if at least one element matches the given predicate
.
the predicate
should have only one character
firstOr (String def )
→ String ?
return first or default value
firstOrIfAbsent (String ifAbsent () )
→ String ?
return first or calls if Absent
lastOr (String def )
→ String ?
return last element or the default value
lastOrIfAbsent (String ifAbsent () )
→ String ?
return last or calls if Absent
replaceAfter (String delimiter , String replacement , [String ? defaultValue ])
→ String
Replaces part of string after the first occurrence of given delimiter with the replacement
string.
If the string does not contain the delimiter, returns defaultValue
which defaults to the original string.
replaceBefore (String delimiter , String replacement , [String ? defaultValue ])
→ String
Replaces part of string before the first occurrence of given delimiter with the replacement
string.
If the string does not contain the delimiter, returns missingDelimiterValue!
which defaults to the original string.