public static string SplitPhone(string phvalue)
{
string result="";
if (phvalue.Contains("-"))
{
return phvalue;
}
else
{
if(phvalue.Length==10)
{
result = phvalue.Substring(0, 3) + "-" + phvalue.Substring(3, 3) + "-" + phvalue.Substring(6, 4);
}
return result;
}
}
{
string result="";
if (phvalue.Contains("-"))
{
return phvalue;
}
else
{
if(phvalue.Length==10)
{
result = phvalue.Substring(0, 3) + "-" + phvalue.Substring(3, 3) + "-" + phvalue.Substring(6, 4);
}
return result;
}
}
No comments:
Post a Comment