Adding Space To String

Hi,

I want to add space in between two strings.

Example Input - WelcomeToUiPathForum
Output Should be - Welcome To UiPathForum

Need to add space between Welcome[Space]To[Space]UiPathForum

Thanks,
Rishi

What is the rule you would follow for this? this should work for some other input strings as well right?

This is a Fixed Format…so we can continue

Can you share your string in which you want add space.

@Rishik_Chowdary you mean you only want the space after “Welcome” and after “To” ?

Exactly @jack.chan

Example Input - WelcomeToUiPathForum
Output Should be - Welcome To UiPathForum

Regex.Replace(“WelcomeToUiPathForum”, “(\p{Lu})”, " $1").TrimStart
\p{Lu} will match an uppercase letter that has a lowercase variant.

if its fixed format can you just do this

txt = txt.Replace("Welcome", "Welcome ")
txt = txt.Replace("To", "To ")

if you want dynamic solution, you can also use this module
Add space before capital letters.xaml (9.2 KB)
but the output will be Welcome To Ui Path Forum

Thanks @jack.chan

One Last Question -

You have given xaml to get split with by Capital letters right…!!

Is there any thing to get both capital and small letters with adding space…!! Thanks

Example
Input - WelcometoUipathforum
Output - Welcome to Uipath forum

@jack.chan

If possible can i get “Add space before small letters.xaml”

Thanks

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