Adding string into Barcode string

  Kiến thức lập trình

I want to add 0 into barcode string ABC4DE. So the output looks like 0ABC4DE.

Here is my code.

        string nZero = "0";
        if (tbReadBarcode2.Text.Contains("rn"))
        {
            tbReadBarcode2.Text = tbReadBarcode2.Text.Replace("rn", nZero + "");
            btnReadBarcode2.Background = Brushes.Green;
            bool result = false;

With this code, the final barcode string looks like this ABC4DE0 instead of 0ABC4DE.
The “0” was added at behind instead in front.
Can anyone help?

0ABC4DE and not ABC4DE0

New contributor

ahmad fahmi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

1

LEAVE A COMMENT