I have a string of the form:
codename123
Is there a regular expression that can be used with Regex.Split() to split the alphabetic part and
Another simpler way is
string originalstring = "codename123";
string alphabets = string.empty;
string numbers = string.empty;
foreach (char item in mainstring)
{
if (Char.IsLetter(item))
alphabets += item;
if (Char.IsNumber(item))
numbers += item;
}
A little verbose, but
Regex.Split( "codename123", @"(?<=[a-zA-Z])(?=\d)" );
Can you be more specific about your requirements? Maybe a few other input examples.