Data update
This commit is contained in:
parent
4d5544505c
commit
4924dd0264
3073 changed files with 55820 additions and 4408 deletions
|
|
@ -0,0 +1,21 @@
|
|||
procedure main()
|
||||
str := "one^|uno||three^^^^|four^^^|^cuatro|"
|
||||
every write("\"",!tokenize(str,"|","^"),"\"")
|
||||
end
|
||||
|
||||
procedure tokenize(str,sep,esc)
|
||||
ret := []
|
||||
token := ""
|
||||
cse := cset(sep||esc)
|
||||
str ?
|
||||
repeat{
|
||||
token ||:= tab(i := (upto(cse) | 0))
|
||||
if i = 0 then return put(ret,token)
|
||||
move(1)
|
||||
if str[i] == sep then{
|
||||
put(ret,token)
|
||||
token := ""
|
||||
}else
|
||||
token ||:= move(1)
|
||||
}
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue