TRIM Spaces from Text as a Command or Express...

expressions
(Colin) #1

TRIM Spaces from Text as a Command or Expression?

Is there some sort of command or expression that can trim text from either end of a text string, please?

I assumed there was one, but upon searching, oddly I cannot find one or it does not exist.

OPAT

(Aleksi Alkio) #2

Would you please give us a sample what you are looking for, thanks.

(Colin) #3

@Aleksi_Alkio For example:

"

The quick brown fox jumps over the lazy dog.

"

becomes

“The quick brown fox jumps over the lazy dog.”

(Aleksi Alkio) #4

Is the start and end “string” always the same like four spaces?

(Colin) #5

@Aleksi_Alkio No, it could be many or a few.

(Aleksi Alkio) #6

Are these values coming from a different service?

(Colin) #7

I am something that behaves like these functions ideally:

docs.microsoft.com - LTrim, RTrim, and Trim functions | Microsoft Docs

and this:

https://www.tutorialspoint.com/java/java_string_trim.htm LTrim, RTrim, and Trim functions | Microsoft Docs docs.microsoft.com

(Praveen Seshadri (AppSheet)) #8

We should have a Trim function! Will get it in next week.

(Praveen Seshadri (AppSheet)) #9

Actually, it will be on Monday! :]

(Colin) #10

@praveen Wow! A new Function in just 7 minutes! It must be an Appsheet record! Thanks!

Hopefully, it might address a minor cosmetic anomaly I encountered yesterday.

(Aleksi Alkio) #11

Okay… I gave up. You can of course create that filter with existing expressions, but it would be quite complex. Praveen’s solution is much quicker :slight_smile: