I need to replace " and instead use <'> for start and </'> for the end in bar code decoding

May 23, 2014 at 4:49 PM
Here is the code
private void DecodeBarcode()
        {
            while (true)
            {
                if (currentBitmapForDecoding != null)
                {
                    var result = reader.Decode(currentBitmapForDecoding);
                    if (result != null)
                    {
                        Invoke(new Action<Result>(ShowResult), result.ToString());
                    }
                    currentBitmapForDecoding.Dispose();
                    currentBitmapForDecoding = null;
                }
                Thread.Sleep(200);
            }
        }
At this point when I scan multiple bar codes I get them like this "barcode", "barcode", "barcode"

I want to be able to replace the " with <'> and at the end of the individual barcode the " with </'>

Could you please suggest a solution?

Thanks,
Vancho
Coordinator
May 26, 2014 at 8:33 PM
Don't use "result.ToString()".
"result" is a class of type "Result" and if you use DecodeMultiple it is an array of that type.
Use the properties of the class "Result" and iterate through every result inside the array.
Build the resulting string yourself with a StringBuilder or something similar.