Data & text · BUILT-IN MODULE

text

Text manipulation helpers.

Quick start

use text
use text

words = text.split "SE is simple" " "
say text.join words "-"
say text.trim "  hello  "

API reference

text.trim text

Trim surrounding whitespace.

移除文字前後空白。
text.contains text search

Check whether Text contains a substring.

檢查 Text 是否包含子字串。
text.starts text prefix

Check a prefix.

檢查文字開頭。
text.ends text suffix

Check a suffix.

檢查文字結尾。
text.replace text old new

Replace text.

替換文字。
text.split text separator

Split Text into a List.

將 Text 切割成 List。
text.join values separator

Join values using a separator.

使用分隔符號連接值。
text.repeat text count

Repeat Text.

重複 Text。