A static extension which provides utility functions for Strings.

Static methods

staticparseJSON(value:String):Dynamic

Parses the string data as JSON and returns the resulting object. This is here so you can use string.parseJSON() when using StringTools.

TODO: Remove this and replace with json2object

Parameters:

value

The

Returns:

The parsed object.

staticsanitize(value:String):String

Remove all instances of symbols other than alpha-numeric characters (and dashes)from a string.

Parameters:

value

The string to sanitize.

Returns:

The sanitized string.

staticstripPrefix(value:String, prefix:String):String

Strip a given prefix from a string.

Parameters:

value

The string to strip.

prefix

The prefix to strip. If the prefix isn't found, the original string is returned.

Returns:

The stripped string.

staticstripSuffix(value:String, suffix:String):String

Strip a given suffix from a string.

Parameters:

value

The string to strip.

suffix

The suffix to strip. If the suffix isn't found, the original string is returned.

Returns:

The stripped string.

statictoLowerKebabCase(value:String):String

Converts a string to lower kebab case. For example, "Hello World" becomes "hello-world".

Parameters:

value

The string to convert.

Returns:

The converted string.

statictoTitleCase(value:String):String

Converts a string to title case. For example, "hello world" becomes "Hello World".

 *

Parameters:

value

The string to convert.

Returns:

The converted string.

statictoUpperKebabCase(value:String):String

Converts a string to upper kebab case, aka screaming kebab case. For example, "Hello World" becomes "HELLO-WORLD".

Parameters:

value

The string to convert.

Returns:

The converted string.