- Posts: 31
Removing spaces in string
- Joe
- Topic Author
- Offline
- User
Less
More
7 years 10 months ago #3073
by Joe
Removing spaces in string - Post(3073) was created by Joe
I am new at this, so I'm sure this is a simple task...
I have a string that may have multiple extra spaces between words: "St Louis, MO" or "St Louis, MO" or "St Louis, MO".
In all cases I want to return only one space between each word. "St Louis, MO"
How can I do this?
I have a string that may have multiple extra spaces between words: "St Louis, MO" or "St Louis, MO" or "St Louis, MO".
In all cases I want to return only one space between each word. "St Louis, MO"
How can I do this?
Please Log in or Create an account to join the conversation.
- FlowHeater-Team
- Offline
- Admin
7 years 10 months ago - 7 years 10 months ago #3074
by FlowHeater-Team
Best wishes
Robert Stark
Replied by FlowHeater-Team on topic Removing spaces in string - Post(3074)
Hi Joe,
To remove spaces in as string you have to use the String Replace Heater with enabled extended settings. (see screenshot below)
In the extended settings you can specify a replace list like this
5 time space,1 space
4 time space,1 space
3 time space,1 space
2 time spcae,1 space
When you disable the option “Termnate list processing after first match” the String Replace Heater loops over all entries and tries to remove first 5 spaces with one, after that 4 spaces with one till end of the list. At the end all spaces are remove and no repeated spaces should occur in the string.
In the attachment you´ll find a simple example how it works.
To remove spaces in as string you have to use the String Replace Heater with enabled extended settings. (see screenshot below)
In the extended settings you can specify a replace list like this
5 time space,1 space
4 time space,1 space
3 time space,1 space
2 time spcae,1 space
When you disable the option “Termnate list processing after first match” the String Replace Heater loops over all entries and tries to remove first 5 spaces with one, after that 4 spaces with one till end of the list. At the end all spaces are remove and no repeated spaces should occur in the string.
In the attachment you´ll find a simple example how it works.
Best wishes
Robert Stark
Attachments:
Last edit: 7 years 10 months ago by FlowHeater-Team.
Please Log in or Create an account to join the conversation.
- Joe
- Topic Author
- Offline
- User
Less
More
- Posts: 31
7 years 10 months ago #3076
by Joe
Replied by Joe on topic Removing spaces in string - Post(3076)
That works great. Thank you!
Please Log in or Create an account to join the conversation.
Time to create page: 0.265 seconds