2023年政策修订增补工作正在进行中,欢迎参与!
模板:Str startswith
跳至導覽
跳至搜尋
本模板用於判斷字符串是否以某一子字符串起始。
用法
{{str startswith|字符串|子串}}
- 字符串
- 必填。原字符串。
- 子串
- 必填。用於判斷的子串。
範例
代碼 | 效果 |
---|---|
{{str startswith|Example|Ex}} |
yes |
{{str startswith|Example|ex}} |
|
{{str startswith|Example|f}} |
|
{{str startswith|Example|Example}} |
yes |
|