• Favorite
  • Facebook
  • Twitter
  • LinkedIn

Microsoft Press Pearson Education (InformIT)
Skip Navigation Links
Pearson Education (InformIT)
How to: Check that a string contains Arabic Characters using C#

Sometimes your application may need to know if a string contains Arabic characters for example if you create an application that sends SMS messages, you need to know the language of the message to handle payment and the length of SMS message differ from Arabic and English messages. You can do that by using the following utility helper method:

internal static bool ContainsArabicLetters(string text)


    foreach (char character in text.ToCharArray())


        if (character >= 0x600 && character <= 0x6ff)

            return true;


        if (character >= 0x750 && character <= 0x77f)

            return true;


        if (character >= 0xfb50 && character <= 0xfc3f)

            return true;


        if (character >= 0xfe70 && character <= 0xfefc)

            return true;



    return false;


There is a way to check that a string contains Arabic characters with regular expressions as in the following method:

internal bool HasArabicCharacters(string text)


    Regex regex = new Regex(


    return regex.IsMatch(text);


This method simply checks that every character in the input text falls in the Unicode Character Code of Arabic characters. You can find all Arabic Unicode Character Codes in the following link

(73) Comments

Blog Message

IKgEWU Thank you ever so for you article.Much thanks again. Keep writing.

Blog Message beats by dr dre

27 yr old Funeral Employees Burton Magnuson from Lantzville, has pastimes which include magic, nike free and bee keeping. Has finished a great round the world trip that covered going to the Historic Centre of the Town of Olinda. beats by dr dre

Blog Message Buy Air Jordan 1 New Ara Store Buy Air Jordan 1

Blog Message kate spade handbag

Locksmith Piker from Whitecourt, has several hobbies that include puppetry, nike free and home for habitat for humanity. Unearthed some interesting spots after spending 7 days at Tsodilo. kate spade handbag

Blog Message new balance 574

Cardiothoracic Surgeon Prenatt from Grande-Riviere, loves lacross, nike free and car. Has signed up for a global contiki trip. Is extremely thrilled in particular about visiting Sanctuary of Asklepios at Epidaurus. new balance 574

Blog Message michael kors clearance

Cardiothoracic Surgeon Daryl Largen from Bowmanville, has hobbies for instance lacross, nike free and ornithology. Will shortly embark on a contiki journey that will cover visiting the Old town of Regensburg with Stadtamhof. michael kors clearance

Blog Message toms shoes

Painting Trades Worker Dority from Acton Vale, enjoys to spend time lawn darts, nike free and string figures. Has toured since childhood and has visited many places, like Historic Centre of the Town of Diamantina. toms shoes

Blog Message dre beats uk

Does it really work? with VI3? We havent upgraded as yet. dre beats uk

Blog Message michael kors outlet online sale

Chemical Place Operator Rusty from Hudson, loves to spend some time photography, nike free and collecting artwork. Is stimulated how large the globe is after making a journey to Stoclet House. michael kors outlet online sale

Blog Message chi straightener

Film, Television, Radio and Stage Owners Julio Faulhaber from Sioux Lookout, enjoys to spend some time becoming a child, nike free and cooking. Has lately finished a travel to Macquarie Island. chi straightener

Blog Message louis vuitton outlet online

Driving Instructor Jesse Brainard from Whistler, likes to spend some time creating, nike free and towards the disabled. Plans to give up work and take the family to numerous great heritage listed locales in the world like New Zealand Sub-Antarctic Islands. louis vuitton outlet online

Blog Message kate spade outlet online

Market Investigation Analyst Atchinson from Colborne, spends time with hobbies for instance frisbee golf (frolf), nike free and hot rods. Very recently had a family journey to Elephanta Caves. kate spade outlet online

Blog Message dr dre beats

22 year old Financial Institution Part Manager Shirley from Gormley, likes knitting, nike free and bringing food to the. Has finished a fantastic around the world journey that included visting the Old Town of Ghadamès. dr dre beats

Blog Message beats by dre solo

Significant kudos Donald with yet another wonderful resource that will serve the entire market. beats by dre solo

Blog Message michael kors handbags clearance

27 year old Traditional Asian Medical Practitioner Chas Faulhaber from Colborne, enjoys to spend some time becoming a child, nike free and papercraft. Has become inspired how enormous the world is after going to Archaeological Heritage of the Lenggong Valley. michael kors handbags clearance

First Previous 1 2 3 4 5 Next Last