跳到正文
本页尚未翻译成中文,以下为英文原文。 查看英文版

substr Function ​

substr extracts a substring from a given string by offset and length.

hcl
substr(string, offset, length)

Examples ​

shellsession
> substr("hello world", 1, 4)
ello

The offset and length are both counted in unicode characters rather than bytes:

shellsession
> substr("🤔🤷", 0, 1)
🤔

基于 MPL-2.0 许可证发布。