Choose Language Hide Translation Bar
Highlighted
vinkane
Level III

Is there a formula to remove white space from a character field ?

Is there a formula to remove white space from a character field. The data field is not supposed to have and white spaces or blank spaces within the field.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
msharp
Super User

Re: Is there a formula to remove white space from a character field ?

More accurately:

regex(text,"\s","",globalreplace);

Your code will only remove spaces, \s will find all white space in regex including tabs, carriage returns, new lines, and a host of other white space characters.

View solution in original post

3 REPLIES 3
Highlighted

Re: Is there a formula to remove white space from a character field ?

Trim will remove white space at the beginning and or the end of the field. I'm not sure if it will remove white space in the middle of the field.

Highlighted
uday_guntupalli
Level VIII

Re: Is there a formula to remove white space from a character field ?

VinKane​ : This will work :
   Name = "Vin Kane" ;
   regex(Name," ","","globalreplace");   // The first character is white space within quotations , the second character is just quotations without a space
ledi.trutna​ : Trim is not capable of replacing the spaces in between - but like you said it works for leading and trailing white spaces

Best
Uday
Highlighted
msharp
Super User

Re: Is there a formula to remove white space from a character field ?

More accurately:

regex(text,"\s","",globalreplace);

Your code will only remove spaces, \s will find all white space in regex including tabs, carriage returns, new lines, and a host of other white space characters.

View solution in original post

Article Labels

    There are no labels assigned to this post.