Results 1 to 3 of 3
  1. #1
    Ricks is offline Member
    Join Date
    Feb 2010
    Posts
    1
    Rep Power
    0

    Default how to convert * into : using java

    Hello All,

    I am very newbie to Java programming. I have a java variable with the following data,

    String data = "231.24.155.162,2620*0*180";

    I would like to convert the * here into : symbol and print the changed valued in variable data.

    Could you please help me how to go get this done. Your help will be highly appreciated.

    Expected output:
    System.out.println ("data is" + data);

    data is 231.24.155.162,2620:0:180
    Thanks,
    Ricks

  2. #2
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    12,996
    Blog Entries
    7
    Rep Power
    19

    Default

    Have you read the API documentation for the String class? It has quite a bit of 'replace' methods available. At least one could do the job for you.

    kind regards,

    Jos

  3. #3
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

Similar Threads

  1. Library - convert Java to UML
    By johnny in forum Advanced Java
    Replies: 2
    Last Post: 10-22-2009, 04:14 PM
  2. Convert .java to .exe
    By susan in forum New To Java
    Replies: 6
    Last Post: 02-11-2009, 06:47 AM
  3. Convert XML file into DTD using Java
    By veera in forum XML
    Replies: 0
    Last Post: 12-19-2008, 05:38 AM
  4. Convert java to .exe
    By heartysnowy in forum New To Java
    Replies: 13
    Last Post: 11-21-2008, 08:16 AM
  5. convert VB6 applications to Java
    By bbq in forum New To Java
    Replies: 1
    Last Post: 07-05-2007, 03:57 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
  •