1214
Views
8
Comments
Solved
Text with no empty spaces
Question

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???

2016-04-22 00-29-45
Nuno Reis
 
MVP
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=""

2021-03-05 13-56-11
Ricardo Pereira
 
MVP

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

2018-12-28 16-42-58
João Lopes

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.

2021-03-05 13-56-11
Ricardo Pereira
 
MVP

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.


2021-03-05 13-56-11
Ricardo Pereira
 
MVP

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


2016-04-22 00-29-45
Nuno Reis
 
MVP
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=""

2018-08-02 14-20-10
Bruno Domingues

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

2018-12-28 16-42-58
João Lopes

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.

2016-04-22 00-29-45
Nuno Reis
 
MVP

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," ")

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.