public static bool CheckIdentifier(String i)
{
bool state = false;
char[] c = i.ToCharArray();
try
{
if (Convert.ToInt32(c[0]) >= 65 && Convert.ToInt32(c[0]) <= 90 || Convert.ToInt32(c[0]) == 95 || Convert.ToInt32(c[0]) >= 97 && Convert.ToInt32(c[0]) <= 122)
{
for (int Index = 0; Index < c.Length; Index++)
{
if (Convert.ToInt32(c[Index]) >= 48 && Convert.ToInt32(c[Index]) <= 57 || Convert.ToInt32(c[Index]) >= 65 && Convert.ToInt32(c[Index]) <= 90 || Convert.ToInt32(c[Index]) == 95 || Convert.ToInt32(c[Index]) >= 97 && Convert.ToInt32(c[Index]) <= 122)
state = true;
else
{
return false;
}
}
}
return state;
}
catch
{ return false; }
} {
Muhammad_70 0 Newbie Poster
ddanbe 2,724 Professional Procrastinator Featured Poster
Muhammad_70 commented: sir kindly can you make it simple??? +0
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.