Below is simple function for checking if ipstring have Arabic Characters in it:
function hasArabic(ipstring)
{
var araChar = 'ئءؤرلاىةوزظطكمنتالبيسشضصثقفغعهخحجد~ْلآآـألأًٌٍَُِلإإ';
var strlen = ipstring.length; // test string length
if (strlen < 1)
{
return false;
}
for (var i = 0; i < ipstring.length; i++)
{
if (araChar.indexOf(ipstring[i]) >= 0) // found
{
return true;
}
}
return false;
}
function hasArabic(ipstring)
{
var araChar = 'ئءؤرلاىةوزظطكمنتالبيسشضصثقفغعهخحجد~ْلآآـألأًٌٍَُِلإإ';
var strlen = ipstring.length; // test string length
if (strlen < 1)
{
return false;
}
for (var i = 0; i < ipstring.length; i++)
{
if (araChar.indexOf(ipstring[i]) >= 0) // found
{
return true;
}
}
return false;
}
Comments
Post a Comment