2Hi.Biz
Trang chủ
|
TWIG
|
Xtscript
|
Templates
|
Xtgem
Functions Xtscript
AiChat.Wap.Sh
substr
cắt các kí tự trong một chuỗi kí tự
[...] = optional ... = your value[var $... = ]call substr $val=…[;$start=…[;$length=…]]
Code ví dụ:
<!--parser:xtscript-->
var $string = abcdefghijklm
var $portion = call substr $val=$string; $start=4 ; $length=6
print string = $string<br />
print portion = $portion
<!--/parser:xtscript-->
<!--parser:xtscript--> var $string = abcdefghijklm var $portion = call substr $val=$string; $start=4 ; $length=6 print string = $string<br /> print portion = $portion <!--/parser:xtscript-->
Code đã chạy:
string = abcdefghijklm
portion = efghij