Zebra Scanner Adding Newline

868 Views Asked by At

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?

1

There are 1 best solutions below

0
On BEST ANSWER

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