How to extract numbers from a string (C# Code)

preview_player
Показать описание
This video shows how we can write C# code to extract numbers including both integers and floats from a string using Regex object.
Рекомендации по теме
Комментарии
Автор

The code for those who don't want to type from the video.. Don't forget to add
using // to the top for regex
using System; // to use the convert to int32
;

void Main () {
string strValue = "YOURINT119282"
Regex re = new Regex(@"[0-9]+");
var matches = re.Matches(strValue);
foreach (Match m in matches) {
Console.WriteLine(m.value);

}

}

corr
visit shbcf.ru