Results 1 to 6 of 6
  1. #1
    gokulcool is offline Member
    Join Date
    Dec 2008
    Posts
    3
    Rep Power
    0

    Smile Display string inside <>

    Hi All,

    I need help from u guys, I need program to display only string of characters inside "<>".
    Like suppose i have string like s = abc<hello>edf;
    I need to print the message like "hello" ie string inside <>.

    Kindly help me out to solve this issue..
    Thanks in advance

  2. #2
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    9

    Default

    regex, maybe?

  3. #3
    gokulcool is offline Member
    Join Date
    Dec 2008
    Posts
    3
    Rep Power
    0

    Smile @above

    Hi thanks for reply...

    Can u help me the code to display the string inside <> using regex.. coz am new to java. so its hard for me to code it... thanks in advance..

  4. #4
    cselic is offline Senior Member
    Join Date
    Apr 2010
    Location
    Belgrade, Serbia
    Posts
    278
    Rep Power
    5

    Default

    I also think that regular expressions would be great for that.

    Please try to write some code. Working with regex is very fun.

  5. #5
    Zack's Avatar
    Zack is offline Senior Member
    Join Date
    Jun 2010
    Location
    Destiny Islands
    Posts
    692
    Rep Power
    5

    Default

    Here is a Java-specific tutorial on Regular Expressions: Lesson: Regular Expressions (The Java™ Tutorials > Essential Classes)

    No one here is going to write the code for you. You can use tutorials online and try to work through it yourself, and ask us for help when you come across errors or problems. But you need to have given it a full attempt first.

  6. #6
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,902
    Rep Power
    25

    Default

    If not regex then the indexOf and substring methods will allow you to extract the characters between < and >

Similar Threads

  1. check string inside string
    By alacn in forum New To Java
    Replies: 8
    Last Post: 07-07-2010, 01:52 PM
  2. JPanel inside Jtabbed isn't display
    By Ravanelly in forum Advanced Java
    Replies: 7
    Last Post: 06-08-2010, 11:19 PM
  3. Replies: 4
    Last Post: 08-28-2009, 08:56 PM
  4. [SOLVED] Getting the value inside a SQL Query into a String.
    By mainy in forum JavaServer Pages (JSP) and JSTL
    Replies: 3
    Last Post: 03-01-2009, 11:08 AM
  5. string inside of a xml
    By Heather in forum XML
    Replies: 2
    Last Post: 03-28-2008, 06:21 PM

Posting Permissions

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