Remove Line Breaks from String

I am getting output like
CLAIMCOUNT\r\n1\r\n
CLAIMCOUNT\r\n2\r\n
But my requirement like
CLAIMCOUNT1,
CLAIMCOUNT2

Set the variable to System.Text.RegularExpressions.Regex.Replace(MyVar, "CLAIMCOUNT\r\n", "CLAIMCOUNT"), where MyVar is your string.

3 Likes

@Aditya10989 Hi,

Or you can use String replace, so use an assign activity, and create a new string variable, for example, call the new string as StringRemove = TheVaribaleContainingTheText.Replace("\r", Nothing).Replace("\n", Nothing)

This will remove \r and \n, leaving you with CLAIMCOUNT1

@Aditya10989

give try on

YourStringVar.Replace(Environment.NewLine, "")
1 Like

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