let {check, ..} = import "lib/assert.ncl" in let {string, ..} = std in [ # string.characters string.characters "ζΌ’ε­—" == ["ζΌ’", "ε­—"], string.characters "πŸ‘¨β€β€οΈβ€πŸ’‹β€πŸ‘¨" == ["πŸ‘¨β€β€οΈβ€πŸ’‹β€πŸ‘¨"], string.characters "ab_cd" == ["a", "b", "_", "c", "d"], string.characters "" == [], string.characters "πŸ˜­πŸ‘»πŸ‘€" == ["😭", "πŸ‘»", "πŸ‘€"], string.characters "πŸ‘©πŸΎβ€πŸ¦²πŸ‘©πŸ»β€πŸ¦²πŸ‘©πŸΏβ€πŸ¦²" == ["πŸ‘©πŸΎβ€πŸ¦²", "πŸ‘©πŸ»β€πŸ¦²", "πŸ‘©πŸΏβ€πŸ¦²"], string.characters "unicΕ‘de" == ["u", "n", "i", "c", "Ε‘", "d", "e"], # string.length string.length "" == 0, string.length " " == 1, string.length "nickel" == 6, string.length m%" a multiline string stretched over lines what length should it be?"% == 65, # Hungarian `Ε‘` character. string.length "unicΕ‘de" == 7, # Vietnamese `ế ` character. string.length "nickếl" == 6, string.length "ε››ε­—η†Ÿθͺž" == 4, string.length "πŸ‘©πŸΏβ€β€οΈβ€πŸ’‹β€πŸ‘©πŸΌ" == 1, string.length "πŸ‘¨β€β€οΈβ€πŸ’‹β€πŸ‘¨" == 1, # string.substring string.substring 3 5 "abcdef" == "de", string.substring 0 6 "nickel is great" == "nickel", string.substring 0 1 "πŸ‘©πŸ»β€πŸ¦²" == "πŸ‘©πŸ»β€πŸ¦²", string.substring 1 6 "πŸ‘¨β€β€οΈβ€πŸ’‹β€πŸ‘¨hello" == "hello", string.substring 2 4 "abπŸ‘¨β€β€οΈβ€πŸ’‹β€πŸ‘¨πŸ‘¨β€β€οΈβ€πŸ’‹β€πŸ‘¨cd" == "πŸ‘¨β€β€οΈβ€πŸ’‹β€πŸ‘¨πŸ‘¨β€β€οΈβ€πŸ’‹β€πŸ‘¨", ] |> check