Hi
I have a textbox which contains Text.
I want to find all the words in the text. (which seprate from each other with space).
what should I do?
thx for ur attention.
Dajer
0
Junior Poster in Training
Recommended Answers
Jump to PostIf you know your string contains only words separated by spaces you could use:
string Mystr = "This is a sentence."; string[] split = Mystr.Split(new Char[] {' '});
Now split[1] would contain the word "is".
Jump to Post>>I want to find all the words in the text. (which seprate from each other with space).
You changed the rulesBut to answer your question you can use RegEx:
private void button15_Click(object sender, EventArgs e) { const string sentence = @"This is Daniweb Forums.Good Luck"; …
Jump to PostDajer,
Comment out the line
System.Diagnostics.Debugger.Break();
. All that line does is make the debugger break. I use that so I can test code and evaluate that it worked properly before I paste it up here :PThe words will not be shown as it currently stands. …
All 12 Replies
DdoubleD
315
Posting Shark
ddanbe
2,724
Professional Procrastinator
Featured Poster
DdoubleD
315
Posting Shark
Dajer
0
Junior Poster in Training
sknake
1,622
Senior Poster
Featured Poster
DdoubleD
commented:
this guy knows everything!
+1
DdoubleD
315
Posting Shark
sknake
1,622
Senior Poster
Featured Poster
Dajer
0
Junior Poster in Training
sknake
1,622
Senior Poster
Featured Poster
Dajer
0
Junior Poster in Training
sknake
1,622
Senior Poster
Featured Poster
ddanbe
2,724
Professional Procrastinator
Featured Poster
DdoubleD
commented:
good follow up
+1
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.