I get a keyboard input in numbers and i want to keep a specific section of them to use in cases
<p>I want to make a program that reads a line of numbers and symbols and I want to read only some specific numbers so I can make 3 cases that then outputs on a textbox something depending on the numbers from that. Can you help me by providing the code necessary for that? (I plan to use it in a windows form application)</p>

<p>Example: I get keyboard input -> <strong>(01)04006544860533(10)L825308500</strong> and from that I want to keep only <strong>04006544860533</strong> so I can use it for case 1 and give me back the textbox4="....". </p>

<p>I can't change the input it has to be the long one.</p>

<p>Edit</p>

<p>Thanks for very fast answer</p>

<p>ok i used the code you provided in a button but i always get the default response on my text box so i think i miss something xD. if i type the number on the cases it works</p>

<p>(Program texts in greek hehe)</p>

<p>Code</p>

<p>private void button1_Click(object sender, EventArgs e)
        {
            string input = BarcodeTextBox.Text;
            string number = input.Substring(5, 14);</p>

<pre><code>        switch (input) //tried switch (number) also
        {
            case ("4006544849033"):
            ProductTextBox.Text = "SLS ΛΕΥΚΗ ΖΑΧΑΡΗ ΑΠΟ ΖΑΧΑΡΟΚΑΛΑΜΟ 1kg";
            break;

            case ("4006544860533"):
            ProductTextBox.Text = "SLS ΑΚΑΤΕΡΓΑΣΤΗ ΖΑΧΑΡΗ 0,5kg";
            break;

            case ("4006544849637"):
            ProductTextBox.Text = "SLS ΑΧΝΗ ΖΑΧΑΡΗ 0,4kg";
            break;

            case ("4006544851630"):
            ProductTextBox.Text = "ΛΕΥΚΗ ΖΑΧΑΡΗ EU2-F 25κιλά ΖΑΧ/ΛΑΜΟ";
            break;

            case ("4006544901137"):
            ProductTextBox.Text = "ΚΡΤΣΤ. ZAX.GR 10X1kg AB";
            break;

            case ("4006544901335"):
            ProductTextBox.Text = "ΚΡΤΣΤ.GR 10X1 Κιλά LIDL ΕΛΛΑΣ";
            break;

            case ("5410256208115"):
            ProductTextBox.Text = "ΚΡΤΣΤ. ZAX.GR 10X1kg ΣΚΛΑΒΕΝΙΤΗΣ";
            break;

            case ("4006544901731"):
            ProductTextBox.Text = "ΚΡΤΣΤ.GR 10X1 Κιλά LIDL ΕΛΛΑΣ DHP";
            break;

            case ("4006544901830"):
            ProductTextBox.Text = "SLS ΑΧΝΗ ΖΑΧΑΡΗ 0,4kg Limited Edition";
            break;

            default:
            ProductTextBox.Text = "Λάθος Αριθμός Barcode, Ξαναπροσπαθήστε";
            break;
        } 
    }
</code></pre>
