This class provides advanced methods on Strings. It is ideally used with using StringTools and then acts as an extension to the String class.

If the first argument to any of the methods is null, the result is unspecified.

Static methods

staticendsWith (s:String, end:String):Bool

Tells if the string s ends with the string end.

If end is null, the result is unspecified.

If end is the empty String "", the result is true.

staticreplace (s:String, sub:String, by:String):String

Replace all occurrences of the String sub in the String s by the String by.

If sub is the empty String "", by is inserted after each character of s. If by is also the empty String "", s remains unchanged.

This is a convenience function for s.split(sub).join(by).

If sub or by are null, the result is unspecified.