2024-01-21 22:05:51 +00:00
|
|
|
%import textio
|
2024-02-07 01:09:08 +00:00
|
|
|
%import string
|
|
|
|
|
2024-01-22 23:56:06 +00:00
|
|
|
%zeropage basicsafe
|
|
|
|
%option no_sysinit
|
2023-12-31 00:02:33 +00:00
|
|
|
|
2024-01-07 17:48:18 +00:00
|
|
|
main {
|
|
|
|
sub start() {
|
2024-02-07 01:09:08 +00:00
|
|
|
str name1 = ""
|
|
|
|
str name2 = "hello \r\n"
|
|
|
|
str name3 = " \n\rhello"
|
|
|
|
str name4 = " \n\r\xa0\xa0\xff\xffhello\x02\x02\x02 \n "
|
2024-02-06 21:18:52 +00:00
|
|
|
|
2024-02-07 01:09:08 +00:00
|
|
|
txt.print("strip:\n")
|
|
|
|
string.strip(name1)
|
|
|
|
txt.chrout('[')
|
|
|
|
txt.print(name1)
|
|
|
|
txt.print("]\n")
|
|
|
|
string.strip(name2)
|
|
|
|
txt.chrout('[')
|
|
|
|
txt.print(name2)
|
|
|
|
txt.print("]\n")
|
|
|
|
string.strip(name3)
|
|
|
|
txt.chrout('[')
|
|
|
|
txt.print(name3)
|
|
|
|
txt.print("]\n")
|
|
|
|
string.strip(name4)
|
|
|
|
txt.chrout('[')
|
|
|
|
txt.print(name4)
|
|
|
|
txt.print("]\n")
|
2024-02-06 23:03:39 +00:00
|
|
|
|
2024-02-07 01:09:08 +00:00
|
|
|
str tname1 = ""
|
|
|
|
str tname2 = "hello \r\n"
|
|
|
|
str tname3 = " \n\r\x09hello"
|
|
|
|
str tname4 = " \n\x09\x0b\r\xa0\xa0\xff\xffhello\x05\x05\x05 \n "
|
2024-02-04 12:50:18 +00:00
|
|
|
|
2024-02-07 01:09:08 +00:00
|
|
|
txt.print("trim:\n")
|
|
|
|
string.trim(tname1)
|
|
|
|
txt.chrout('[')
|
|
|
|
txt.print(tname1)
|
|
|
|
txt.print("]\n")
|
|
|
|
string.trim(tname2)
|
|
|
|
txt.chrout('[')
|
|
|
|
txt.print(tname2)
|
|
|
|
txt.print("]\n")
|
|
|
|
string.trim(tname3)
|
|
|
|
txt.chrout('[')
|
|
|
|
txt.print(tname3)
|
|
|
|
txt.print("]\n")
|
|
|
|
string.trim(tname4)
|
|
|
|
txt.chrout('[')
|
|
|
|
txt.print(tname4)
|
|
|
|
txt.print("]\n")
|
2024-02-03 00:57:17 +00:00
|
|
|
}
|
|
|
|
}
|