String.k 713 B

1234567891011121314151617181920212223242526
  1. invoke {
  2. assert '' is String
  3. assert "" is String
  4. assert '"' + "'" is String
  5. assert '123' + '456' == '123456'
  6. assert 'aBcD' -> to_lower_case() == 'abcd'
  7. assert 'aBcD' -> to_upper_case() == 'ABCD'
  8. let CHARS = ['1', 'A', 'あ', '大', '𣾜', '📞']
  9. let CODES = [49, 65, 12354, 22823, 147356, 128222]
  10. let list = collect('1Aあ大𣾜📞')
  11. assert list is List
  12. assert len(list) == 6
  13. for char[i] in list {
  14. assert char == CHARS[i]
  15. assert ord(char) == CODES[i]
  16. assert char == chr(CODES[i])
  17. }
  18. assert utf8_size('1Aあ大𣾜📞') == 16
  19. let s = '''
  20. Heredoc St'ri"ng
  21. ''
  22. Multi-Line
  23. '''
  24. assert s is String
  25. }