c# - convert string to int with losing everything but digits -
i have string
string = "234234324\r\n";
i want parse string integer losing \r\n
part, int
should contain digits string int b = 234234324
;
p.s. string not contain \r\n
part, point want use digits string.
i tried convert.toint32(a)
have error.
int b = int.parse(new string(a.where(char.isdigit).toarray()));
Comments
Post a Comment