Il ta répondu..
Si oui, il te faudra connaitre la composition des trames.
1 2 3 4 5 6 7
| Foreach(char n in RichTextBox.Text)
{
... analyse character par character.
...
Utilisation d un regex: Regex.Match(subjectString, @"-?\d+").Value <-- support les nombres négatifs
ou du substring pourrais aider.
} |
Sinon si un caractère sépare le numérique de l'Alpha
var split = RichTextBox.Text.Split(';');
EDIT:
Je viens de trouver ça, c'est un début:
1 2 3 4 5 6 7 8 9 10 11 12
| string a = "str123";
string b = string.Empty;
int val;
for (int i=0; i< a.Length; i++)
{
if (Char.IsDigit(a[i]))
b += a[i];
}
if (b.Length>0)
val = int.Parse(b); |
Partager