123456789101112131415161718192021222324252627 |
- assert_eq(str_length(""), 0)
- assert_eq(str_length("foo"), 3)
- assert_eq(str_slice("hello world", 0, 5), "hello")
- assert_eq(str_slice("hello world", 6, 11), "world")
- assert_eq(str_slice("hello world", 0, 0), "")
- assert_eq(str_slice("hello world", 0, 100), "")
- assert_eq(chr(65), "A")
- assert_eq(chr(97), "a")
- assert_eq(chr(0x2764), "❤")
- assert_eq(ord("A"), 65)
- assert_eq(ord("a"), 97)
- assert_eq(ord("❤"), 0x2764)
- assert_eq(str_append("foo", "bar"), "foobar")
- assert(str_contains("hello world", "hello"))
- assert(str_contains("hello world", "world"))
- assert_eq(str_contains("hello world", "HELLO"), false)
- assert_eq(str_replace("hello world", "hello", "HEY"), "HEY world")
- assert_eq(str_replace("xxx", "x", "yY"), "yYyYyY")
- assert_eq(str_replace("a b", " ", " "), "a b")
- assert_eq(str_repeat("xy", 3), "xyxyxy")
|