Display string inside <>
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
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..
I also think that regular expressions would be great for that.
Please try to write some code. Working with regex is very fun.
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.
If not regex then the indexOf and substring methods will allow you to extract the characters between < and >