// retoor <retoor@molodetz.nl>
import "strutil" for Str
System.print(Str.toLower("HELLO World")) // expect: hello world
System.print(Str.toLower("abc123")) // expect: abc123
System.print(Str.toLower("")) // expect:
System.print(Str.toUpper("hello World")) // expect: HELLO WORLD
System.print(Str.toUpper("ABC123")) // expect: ABC123
System.print(Str.toUpper("")) // expect:
System.print(Str.hexEncode("ABC")) // expect: 414243
System.print(Str.hexEncode("\x00\xFF")) // expect: 00ff
System.print(Str.hexEncode("")) // expect:
System.print(Str.hexDecode("414243")) // expect: ABC
System.print(Str.hexDecode("")) // expect:
System.print(Str.repeat("ab", 3)) // expect: ababab
System.print(Str.repeat("x", 5)) // expect: xxxxx
System.print(Str.repeat("", 10)) // expect:
System.print(Str.padLeft("hi", 5, " ")) // expect: hi
System.print(Str.padLeft("hello", 3, " ")) // expect: hello
System.print(Str.padLeft("x", 4, "0")) // expect: 000x
System.print("[" + Str.padRight("hi", 5, " ") + "]") // expect: [hi ]
System.print(Str.padRight("hello", 3, " ")) // expect: hello
System.print(Str.padRight("x", 4, "0")) // expect: x000
System.print(Str.escapeHtml("<div class=\"test\">A & B</div>")) // expect: &lt;div class=&quot;test&quot;&gt;A &amp; B&lt;/div&gt;
System.print(Str.escapeHtml("hello")) // expect: hello
System.print(Str.escapeHtml("it's")) // expect: it&#39;s
System.print(Str.escapeJson("hello")) // expect: "hello"
System.print(Str.escapeJson("a\"b")) // expect: "a\"b"
System.print(Str.escapeJson("line1\nline2")) // expect: "line1\nline2"
System.print(Str.urlEncode("hello world")) // expect: hello+world
System.print(Str.urlEncode("test")) // expect: test
System.print(Str.urlDecode("hello+world")) // expect: hello world
System.print(Str.urlDecode("test")) // expect: test