Is there an alternative to using a regular expression to detect if a string contains uppercase characters? Currently I\'m using the following regular expression:
<
using for loops, not as efficient and readable as the other methods pointed out, but for starters should work and provide a comprehensive way of doing this:
int counter = 0;
for(int i=0; i< myString.Length;i++)
{
//if character is upper add +1 to counter
if(char.IsUpper(chaineNonPascale[i]))
{
counter++;
}
}
Basically, you iterate over your string and check for Upper Chars, then you can add logic as to what to do with the place where there is an Upper Char. For example, insert a space where the second upper case char is found and then use the ToLower method on the whole string...