How to remove space after string

Hi All,

I am unable to remove space after string. Can some one help me.

Example Test (save

I want to remove space and special character after “Test”

@thima

You can do with Regex Replace

For Regex configuration check below

Mark as solution if this helps

@thima

Similar ways of doing it is ,

Using replace function of String

image

OR

Using regex,
where finalStr = System.Text.RegularExpressions.Regex.Replace(str, “[^\w\d]+”, “”)

image

i want only “Test”

Try like this
image

@thima

StringVar = StringVar.Split(" "c).FirstOrDefault

will cut out everything starting with first space to the right.

Cheers

libork

2 Likes

@thima

If you need on “Test” and always you will get as “(” symbol then you can use as below

Mark as solution if this helps

Thanks

3 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.