Need to Remove Empty Space from a middle of a string and the half of the string will be in new line

Hi Everyone,

Need help for removing a Empty Space from a middle of a string.

Due to Enter Key the value will be in next line.

Tried all Trim, TrimEnd, TrimStart .

Example string:
Hello
Maddy

Needed Answer : HelloMaddy

Could someone help me with this.

Hi @maddy99 … Please try this…

image

To use Regex.Replace please import system.text.regularexpressions or use it as system.text.regularexpressions.regex.replace

2 Likes

Hi @prasath17 ,

It worked, Thanks for the help!

Can you please explain the vbCr and vbLf because I know vbTab only :expressionless:

Thanks for the confirmation. Once you are done with the testing please mark my post as solution , as that help others.

When I copied your text, this is what I noted in Notepad++.

image

Please find the reference here…

1 Like

Thanks for the clarification :slight_smile: and marked it as solution.

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