Thank you for the all knowledge you shared with me :)
It was like a private lesson covering String topic!
Type: Posts; User: beer-in-box
Thank you for the all knowledge you shared with me :)
It was like a private lesson covering String topic!
This :) :
Can you give me some clues so that I can try to figure it out. My first attempt failed as always :D
Okay, so all happened because I was lazy and didn't use nextLine...
So, can you examplify what you told please?
And,in "[:,\\s]+", why are we using "+" and why do we put two "\"s?
It works when I use it like you use (when I define the string and don't get from the user). But when I want to use it with Scanner, it fails. Could you run this code when you are free and tell me why...
I suspected this :) So, I will examplify it. Here is my code again, which works when the input doesn't have a space:
public void metotUc(){
input = new Scanner(System.in);...
Thank you once again. This solves one of my problems here.
But I still have the same damn thing. Why do I have "This" as an output when I enter "This is a trial, to use split: methods."? How can I...
Haha, I should have read more carefully. Ignore the previous post please :)
I found the answer to my first question:
public void metotUc(){
input = new Scanner(System.in);...
Thanks for the answer. I also learnt that StringTokenizer is a legacy class while I was researching about splitting text.
About the Pattern API, either I miss something big or it won't help me...
Hi,
I was trying to learn about dealing with Strings. I came across with StringTokenizer. It seemed like it makes things easier, but I cannot seperate a text if I put a space between words. Here is...