Built-In Functions

Wasabi provides a number of built-in functions for string manipulation and other utilitiles. In general, you should prefer to use the appropriate .NET methods since they are better documented, more discoverable and in some cases, strictly better.

Join(array, delimiter)

Joins the array with the supplied delimiter:

Dim values = Array("one", "two", "three")
Dim csv = Join(value, ", ")

Trim(string)

Returns a copy of the string with leading and trailing whitespace removed:

Dim hello = "     hello    "

CharAt(string, i)

Warning

You should use the System.String‘s item getter instead.

Gets the character at the position i:

Dim w = "Hello world!".CharAt(6)

Len(string)

Warning

You should use System.String‘s Length property instead.

Returns the length of a string, or 0 for Nothing:

Dim length = Len("Hello World!")

Mid(string, start, Optional count)

Warning

You should use System.String‘s Substring method instead.

Extracts a substring:

Dim world = Mid("Hello world!", 7, 5)

Right(string, count)

Warning

You should use System.String``s ``Substring method instead.

Extracts the substring composed of the count right most characters in string:

Dim world = Right("Hello world", 5)

Left(string, count)

Warning

You should use System.Strings‘s Substring method instead.

Extracts the substring composed of the count left most characters in string:

Dim hello = Left("Hello world!", 5)

UCase(string)

Warning

You should use System.String‘s ToUpper method instead.

Returns a copy of the string converted to upper case:

Dim HELLO = UCase("hello")

LCase(string)

Warning

You should use System.String‘s ToLower`` method instead.

Returns a copy of the string converted to lower case:

Dim hello = LCase("HELLO")

InStr(Optional start, string, searchFor)

Warning

You should use System.String‘s IndexOf method instead.

Returns the 1-index based position of searchFor if it occurs in string starting at start, otherwise, it returns 0:

Dim seven = InStr("Hello world!", "world")

InStrRev(string, searchFor, Optional start)

Warning

You should use System.String‘s LastIndexOf method instead.

Returnst the 1-index based position of the last occurance of searchFor if it occurs in string starting at start, otherwise, it returns 0:

Dim seven = "InStrRev("world world!", "world")