Text with no empty spaces

Good afternoon, i want to trim the middle spaces of a text data type. How can i do that? The Trim function only works with the start or the end of that text...Can i use the substring function to check each position of the text until i found the empty space???

Hi João,


I don't know if this is the case, but you can use this: https://www.outsystems.com/forge/component-overview/4945/just-letters


If you want to maintain the other characters that aren't letters you just need to tweak the C# code of the extension.


Hope this can help.


Best regards,

Ricardo

Ricardo Pereira wrote:

Hi João,


I don't know if this is the case, but you can use this: https://www.outsystems.com/forge/component-overview/4945/just-letters


If you want to maintain the other characters that aren't letters you just need to tweak the C# code of the extension.


Hope this can help.


Best regards,

Ricardo


It's suppose to be a URL, so i need to maintain the other characters that are no letters. But thanks, i will try it.

João Lopes wrote:

Ricardo Pereira wrote:

Hi João,


I don't know if this is the case, but you can use this: https://www.outsystems.com/forge/component-overview/4945/just-letters


If you want to maintain the other characters that aren't letters you just need to tweak the C# code of the extension.


Hope this can help.


Best regards,

Ricardo


It's suppose to be a URL, so i need to maintain the other characters that are no letters. But thanks, i will try it.

Ok. You just need to open the C# code and edit the method. With that I think that you will be just fine.


Solution

There is a basic function that can remove all spaces.


Replace(t, search, replace)Returns Text 't' after replacing all Text occurrences of 'search' with 'replace'.


Try it with search=" " replace=""

Solution

João Lopes wrote:

Ricardo Pereira wrote:

Hi João,


I don't know if this is the case, but you can use this: https://www.outsystems.com/forge/component-overview/4945/just-letters


If you want to maintain the other characters that aren't letters you just need to tweak the C# code of the extension.


Hope this can help.


Best regards,

Ricardo


It's suppose to be a URL, so i need to maintain the other characters that are no letters. But thanks, i will try it.

Hi João,

I made an upload right now with a new version of JustLetters that already have a method to remove white spaces.

Hope this can help.


Regards,

Ricardo


João Lopes wrote:

Good afternoon, i want to trim the middle spaces of a text data type. How can i do that? The Trim function only works with the start or the end of that text...Can i use the substring function to check each position of the text until i found the empty space???

Hello João Lopes,

If I understand what you want to do, you can use the Replace Function.

Example:

Function Replace

SyntaxEditor Code Snippet

Replace("https://sdfs df s sdf sfd  sdf sf . sdfs df  sdf "," ","")
Result: https://sdfsdfssdfsfdsdfsf.sdfsdfsdf



Hope this can help.

Best Regards,

Bruno Domingues

Bruno Domingues wrote:

João Lopes wrote:

Good afternoon, i want to trim the middle spaces of a text data type. How can i do that? The Trim function only works with the start or the end of that text...Can i use the substring function to check each position of the text until i found the empty space???

Hello João Lopes,

If I understand what you want to do, you can use the Replace Function.

Example:

Function Replace

SyntaxEditor Code Snippet

Replace("https://sdfs df s sdf sfd  sdf sf . sdfs df  sdf "," ","")
Result: https://sdfsdfssdfsfdsdfsf.sdfsdfsdf



Hope this can help.

Best Regards,

Bruno Domingues




Like this right, just need to compare both strings now. But thanks for the Help.

Compare? If your goal is to know if the text has a space, the best way is Index. If it returns -1 there are no spaces.

Just like this Index(String," ")