2Hi.Biz
Trang chủ | TWIG | Xtscript | Templates | Xtgem
Functions Xtscript
AiChat.Wap.Sh
Rtrim
Loại bỏ khoảng trắng (hoặc các ký tự khác) từ đầu của một chuỗi
[...] = optional ... = your value [var $... = ]call rtrim $val=…[;$charlist=…]
Code ví dụ:
<!--parser:xtscript-->
#assign a space to a variable
var $space =call chr $val=32 var $input =xyz FOOBAR zyx
var $input =$space$input$space # default rtrim
var $output = call rtrim $val=$input
print default rtrim<br />
print input =|$input|<br />
print output =|$output|<hr /> # a space can be added (not at the end) as a part
of a $charlist of 2 or more characters
var $output = call rtrim $val=$input ; $charlist=xy z
print a space in the charlist<br />
print input = |$input|<br />
print output = |$output|<hr /> # specify a range of characters with ..
var $input = ABCDEFGHIJKLMABCDEF
var $output = call rtrim $val=$input ; $charlist= A..F
J..M
print trim a range of characters<br />
print input = $input<br /> print output = $output
<!--/parser:xtscript-->
Code đã chạy:
default rtrim
input =| # default rtrim|
output =| # default rtrim|
# a space can be added (not at the end) as a parta space in the charlist
input = | # default rtrim|
output = | # default rtrim|
# specify a range of characters with ..trim a range of characters
input = ABCDEFGHIJKLMABCDEF
print output = ABCDEFGHIJKLM