Results 1 to 5 of 5
  1. #1
    Tamu is offline Member
    Join Date
    Nov 2008
    Posts
    19
    Rep Power
    0

    Default code point of stirng to string

    Hello,

    Somebody know how a method that transform a code point of string to string?

    The case is, I am using codePointCount-method of string to int. How from int to String? Is it possible?
    Last edited by Tamu; 11-29-2008 at 02:38 PM. Reason: add missing part

  2. #2
    serjant's Avatar
    serjant is offline Senior Member
    Join Date
    Jun 2008
    Location
    Ukraine,Zaporozhye
    Posts
    487
    Rep Power
    7

    Default

    From int to String:

    Java Code:
    int var=1;
    String varStr=String.valueOf(var);

  3. #3
    Tamu is offline Member
    Join Date
    Nov 2008
    Posts
    19
    Rep Power
    0

    Default

    sorry, i will make it more clearlier.

    Is there some easy way to change a string to some kind of string code then we can transform string code back to string again.

    Need it because, if an other unknown person (let it be person A) have my source code and A has different characters encoding way, then the source code that A is looking is different, because eclipse will change all unsupported character to something else or add some quares.

    I have my solution, but it looks so ugly, I can't accept it - Maybe I will use it as my last choice. =)
    Last edited by Tamu; 11-29-2008 at 03:51 PM. Reason: misspelled

  4. #4
    Tamu is offline Member
    Join Date
    Nov 2008
    Posts
    19
    Rep Power
    0

    Default

    An example

    Java Code:
    String euro = "euro = €";
    
    //to string code.
    int euroCode = euro.codePointCount(0, euro.length());
    
    String mustBeEuro = "do some thing with euroCode so it have the same 
                                      string as euro"
    Last edited by Tamu; 11-29-2008 at 04:01 PM. Reason: misspelled again ^^

  5. #5
    Tamu is offline Member
    Join Date
    Nov 2008
    Posts
    19
    Rep Power
    0

    Default

    I can tell my way to solve my problem.

    String => char array => int array => char array => String

    Getting a numeric code(s) is most important part to transform to string. In this case, int array is what I need =)

Similar Threads

  1. Point System
    By Zosden in forum Suggestions & Feedback
    Replies: 2
    Last Post: 02-14-2009, 12:45 PM
  2. String Code Indentation
    By andysh in forum New To Java
    Replies: 1
    Last Post: 12-22-2007, 02:45 AM
  3. is it bug? or am i missing a point?
    By blowguy in forum Threads and Synchronization
    Replies: 1
    Last Post: 11-20-2007, 06:19 PM
  4. Help with Switch string code
    By toby in forum New To Java
    Replies: 1
    Last Post: 08-07-2007, 06:00 AM

Posting Permissions

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