Created
September 27, 2023 16:00
-
-
Save ncalm/621f7055fed1bd5f7c0d3f6b757dc91e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // trip leading chars | |
| lstrip = LAMBDA(text, char, | |
| BYROW(text, | |
| LAMBDA(t, IF(LEFT(t)=char, lstrip(MID(t,2,len(t)),char), t)) | |
| ) | |
| ); | |
| // trim trailing chars | |
| rstrip = LAMBDA(text, char, | |
| BYROW(text, | |
| LAMBDA(t, IF(RIGHT(t)=char, rstrip(MID(t,1,len(t)-1),char), t)) | |
| ) | |
| ); | |
| // trim both chars | |
| strip = LAMBDA(text, char, rstrip(lstrip(text,char),char)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment