Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,8 @@
|
|||
fcn strip(text,c){ // if c in text, remove it and following text
|
||||
if (Void!=(n:=text.find(c))) text=text[0,n];
|
||||
text.strip() // remove leading and trailing white space
|
||||
}
|
||||
fcn stripper(text,a,b,c,etc){ // strip a,b,c,etc from text
|
||||
foreach c in (vm.arglist[1,*]){ text=strip(text,c) }
|
||||
text
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
fcn stripper(text,a,b,c,etc){
|
||||
vm.arglist[1,*].reduce('wrap(text,c){
|
||||
if (Void!=(n:=text.find(c))) text[0,n] else text
|
||||
},text)
|
||||
.strip()
|
||||
}
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
String(">", strip(" apples, pears # and bananas","#"), "<").println();
|
||||
String(">", stripper(" apples, pears ; and # bananas","#",";"), "<").println();
|
||||
Loading…
Add table
Add a link
Reference in a new issue