Close The Space In Strings

Hi All, how do I close up the space from ’ " ’ to the G in goodmorning on this string
image

@Anelisa_Bolosha1 Use Assign Activity:

cleanText = originalText.Trim()

Please let me know if it works or not

@Anelisa_Bolosha1

If you want to remove only spaces from " to G then use: " Good Day with …".TrimStart()

If want to remove spaces from both start and end then use: " Good Day with …".Trim()

@Anelisa_Bolosha1

You want to keep consistent spacing in between and at the end as well try this logic.

System.Text.RegularExpressions.Regex.Replace(cleanString, "\s+", " ")

Then use stringvariable.Trim to tirm the leading and trailing spaces.

This worked thanks so much @Dhruba_Jyoti_Kalita