Trimming string output

Hi All,

I am getting a string output as “No\r\n”. How can I remove ‘\r\n’ and trim it?

Just try this @somya177,

(string.split("\"c).First()) .Trim :slight_smile:

you can use String.Replace("\r\n","")

Hi @somya177

  • Store your value “No\r\n” in Str Variable.
  • then use Str.Split(""c)(0) So it will give result as No.

it gives error that character constant must contain exactly one character

What you have tried :slight_smile: @somya177?

@somya177
Try this Str.Split("\"c)(0) .

that’s only I have tried…it hasn’t give the result as “No” .infact the same value

Have you tried this?

String = string.Trim.split("\"c).First()

1 Like

@somya177

Could you share a screenshot of the code that you have used to remove the characters?

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