owl1929839
owl1929839

Reputation: 11

Zebra Scanner Adding Newline

I'm using a Zebra TC70 with DataWedge to capture scanned data. Every barcode I scan is having \r\n appended to the end.

Why is it doing this and how can I stop it?

Upvotes: 0

Views: 1205

Answers (1)

Juan Sturla
Juan Sturla

Reputation: 1304

When you use any barcode reader, they usually come with a manual which include configurations. Like what characters should include after the reading.

For your particular scanner you can check this

The characters \r\n are escape characters indicating a new line.

Sometimes it's there, sometimes it's not, depending on the configuration of the reader.

If it bothers you, you can always replace the unwanted characters by empty characters

string myInput;
myInput=myInput.Replace("\r\n","");

myInput.Trim("\r\n".ToCharArray()) or TrimEnd are other alternatives

Upvotes: 1

Related Questions