Results 1 to 4 of 4
  1. #1
    mnoko is offline Member
    Join Date
    Feb 2012
    Posts
    1
    Rep Power
    0

    Default How to deal with Arabic string in java

    Hi every one,

    I need to remove arabic diactries from the input text..

    I had tried this code but it take to much time to complete,

    Java Code:
    for ( int index = 0 ; index < word.length() ; index++)
                     {
                     char x = word.charAt(index);
                     if ((x >= 'ء' && x <= 'غ') || (x >= 'ف' && x <= 'ي'))
                    	 wordAfter += x;
                     }
    and it maybe delete wanted characters, also, I had tried using replaceAll() but I did not success with it
    Som is there other ways to remove them, such as using Normalize class???

    Thanks

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Moderator
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    9,936
    Rep Power
    16

    Default Re: How to deal with Arabic string in java

    I had tried using replaceAll() but I did not success with it
    Show your attempt, in code.

    Learning resource:
    Regular-Expressions.info - Regex Tutorial, Examples and Reference - Regexp Patterns
    Lesson: Regular Expressions (The Java™ Tutorials > Essential Classes)

    db
    Why do they call it rush hour when nothing moves? - Robin Williams

  3. #3
    Join Date
    Apr 2012
    Posts
    1
    Rep Power
    0

    Default Re: How to deal with Arabic string in java

    I think each character is represented by a byte, not char. Try using the get bytes()

  4. #4
    DarrylBurke's Avatar
    DarrylBurke is offline Moderator
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    9,936
    Rep Power
    16

    Default Re: How to deal with Arabic string in java

    Quote Originally Posted by Lyricalextreme View Post
    I think ...
    Don't think. If you want to help, research first so you don't post garbage.

    db
    Why do they call it rush hour when nothing moves? - Robin Williams

Similar Threads

  1. How do I deal with entries that don't exist
    By Jossos in forum New To Java
    Replies: 11
    Last Post: 01-05-2012, 02:34 AM
  2. How to best deal with large file uploads ?
    By HeapSpace in forum Advanced Java
    Replies: 36
    Last Post: 06-08-2011, 07:32 PM
  3. Replies: 11
    Last Post: 11-02-2010, 05:46 PM
  4. how to display arabic language in java from mysql
    By pencariilmu in forum Advanced Java
    Replies: 0
    Last Post: 02-11-2010, 01:20 AM
  5. Replies: 1
    Last Post: 08-07-2007, 05:37 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •