Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -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
}

View file

@ -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()
}

View file

@ -0,0 +1,2 @@
String(">", strip(" apples, pears # and bananas","#"), "<").println();
String(">", stripper(" apples, pears ; and # bananas","#",";"), "<").println();