indiedev91
(Indie Dev 91)
October 1, 2023, 7:20am
1
Hello , im facing a wierd situation here , the String.Trim function is not able to remove spaces in between of words
here is the string for eg
“Pdl Delinquncy file”
After the trim it should be
“PdlDelinquencyfile”
But it still showing “Pdl Delinquency file” in the immediate panel
this source for the strings is from get text , and it is happening for each text that has been extracted from that particular UiElement
Here is a immediate panel screenshot
Vikas_M
(Vikas M)
October 1, 2023, 7:26am
2
indiedev91:
Hello , im facing a wierd situation here , the String.Trim function is not able to remove spaces in between of words
here is the string for eg
“Pdl Delinquncy file”
After the trim it should be
“PdlDelinquencyfile”
But it still showing “Pdl Delinquency file” in the immediate panel
Hey @indiedev91 ,
The String.Trim
function in UiPath is designed to remove leading and trailing spaces by default, not spaces within the string. To remove spaces within the string, you can use the String.Replace
function.
Assign
Inputstring = “Pdl Delinquncy file”
InputString = inputString.Replace(" ", “”)
Hope it helps you !
lrtetala
(Lakshman Reddy)
October 1, 2023, 7:26am
3
Hi @indiedev91
String.Trim
only removes leading and trailing spaces (whitespace) from the string, not spaces between words.
To remove spaces between words within a string, you should use the String.Replace
method.
Input = "Pdl Delinquncy file"
Output = Input.Replace(" ", "")
Hope this helps!!
indiedev91
(Indie Dev 91)
October 1, 2023, 7:43am
4
Okay Im So Sorry for this Dumb Question , i just used .Replace(" “,”")
lrtetala
(Lakshman Reddy)
October 1, 2023, 8:16am
5
@indiedev91
Hope it is clarified
If yes would recommend to close it
Forum FAQ - How to mark a post as a solution
This document is part of our beginners guide .
This article will teach you how to properly mark a post as a solution.
We were closely following our last UiPath Forum feedback round! topic and carefully extracted all the bits of feedback that was provided. As such, we would like to tackle the topic of solutions on our Forum and how to properly use them.
When is the topic resolved?
The topic can be considered resolved when the topic author has fo…
system
(system)
Closed
October 4, 2023, 8:16am
6
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.