How to trim first and last letter in a sentence?
Example: I have a sentence that start and end with % , so i want to trim % from both start and end of the sentence.
How to trim first and last letter in a sentence?
Example: I have a sentence that start and end with % , so i want to trim % from both start and end of the sentence.
@Anusuya_R ,U can try.
string_len = YourString.Length
YourCutString = YourString.SubString(1,string_len-2)
Nope… It didnt work
I have set of rows with particular value.Not all the row value begins with $ so i think it wont work
@Anusuya_R ,Ok,there are have fixed number of words sames like “$”?Or it is random?
Hi @Anusuya_R ,
Could you show us How you have implemented it ?
In Addition, also give a try on the below :
yourStrVar.Trim.Trim("%".ToCharArray)
Do note that %
was the symbol that you have mentioned earlier that you want to remove.
What is the actual set of characters that you want to Trim?
Hi @Anusuya_R
Assign InputString = InputString.Trim(" “c,”%"c)
This will remove empty spaces and % in start and end.
Try this and Please let me know if this worked or not
Perfect… Its working !!!
Hi,
I have a point to add here, If we are using Replace for ‘%’ then it will replace all % in the text. But If we used trim then with character then it will remove only in start and ends.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.