| Author: yogaraj.p 10 Jan 2009 | Member Level: Silver | Rating:  Points: 1 |
what will happen if the string will have three numeric values in end of the string
|
| Author: yogaraj.p 10 Jan 2009 | Member Level: Silver | Rating:  Points: 2 |
no appukuttam, it wont work... because value.length-2 will remove only 2 values. if the string is keyword2345 then it will return keyword23 right. but i need only "keyword".
|
| Author: Babu Kumarasamy 10 Jan 2009 | Member Level: Gold | Rating:  Points: 2 |
Hi
use this
string rem = "45babu1234"; char[] c = { '1', '2', '3', '4', '5', '6', '7', '8', '9', '0' }; string both = rem.Trim(c); string end = rem.TrimEnd(c); string start = rem.TrimStart(c);
|
| Author: selvakumar.A 30 Jan 2009 | Member Level: Bronze | Rating:  Points: 2 |
Hi,
Try the following one
string name = "kkkk1234"; string result;
for (int i = 0; i <= name.Length - 1; i++) { if (char.IsDigit(Convert.ToChar(name.Substring(i, 1))) == false) { result += name.Substring(i, 1); } } MessageBox.Show(result);
|