String manipulation1

i have string within data row as “ABB
Company” and the required format is “ABB Company”…how can i achieve this…Kindly help

Thanks

1 Like

@Samsanditha

System.Text.RegularExpressions.Regex.Replace(YourString,"[\n]","")

2 Likes

Fine
hope this expression would help you
str_input = “ABB
Company”

then
str_output = String.Join(" ",str_input.Split(Environment.NewLine.ToArray()))

Cheers @Samsanditha

If I’ve understood correctly, your data row has a carriage return between the first and the second word?

In this instance if your variable is named varName
Use an ‘if’ statement with the condition varName.Contains(vbCr) or varName.Contains(vbLf)
Within ‘Then’ use an Assign varName = varName.Replace(vbCr,"")
varName = varName.Replace(vbLr,"")

Hope this helps

Thanks for the response…But i cudn’t get the required output

Thank you…got the desired output

1 Like

Thanks for the response.when i tried this expression i got an error as vbLr is inaccessible

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