how to compare eachline in a richtextbox with an hashtable? if match write in a text file
plz help...........
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Felipe RamosRank #1,409 · 1.2K reputationPosted Sep 28, 2010, 6:11 AM EDT
vishnu krishnan103 reputationPosted Sep 29, 2010, 7:40 PM EDT
Felipe RamosRank #1,409 · 1.2K reputationPosted Sep 30, 2010, 4:42 AM EDT
vishnu krishnan103 reputationPosted Sep 30, 2010, 6:37 AM EDT
help?
Felipe RamosRank #1,409 · 1.2K reputationPosted Sep 30, 2010, 6:55 AM EDT
vishnu krishnan103 reputationPosted Sep 30, 2010, 7:16 AM EDT
this nothing write into the file...
StreamWriter writer = new StreamWriter("D:\\help.txt", true);
using (System.IO.StringReader reader = new System.IO.StringReader(richTextBox1.Text))
{
while (reader.Peek() > 0)
{
string line = reader.ReadLine();
if (hash.ContainsValue(line))
{
writer.WriteLine(line);
}
}
}
}
vishnu krishnan103 reputationPosted Sep 30, 2010, 7:22 AM EDT
Felipe RamosRank #1,409 · 1.2K reputationPosted Sep 30, 2010, 8:46 AM EDT
vishnu krishnan103 reputationPosted Sep 30, 2010, 9:19 AM EDT
plz chk this.............................
private void CreateArray()
{
Hashtable hash = new Hashtable();
hash.Add("1", "int");
hash.Add("2", "float");
using (System.IO.StringReader reader = new System.IO.StringReader(richTextBox1.Text))
{
while (reader.Peek() > 0)
{
string line = reader.ReadLine();
if (hash.ContainsValue(line))
{
MessageBox.Show(line);
}
}
}
}
can u change write to a file with messagebox....
if u get plz let me knw ........
Felipe RamosRank #1,409 · 1.2K reputationPosted Sep 30, 2010, 10:02 AM EDT
vishnu krishnan103 reputationPosted Sep 30, 2010, 10:34 AM EDT
i have another simple problem, i expect ur idea.plz.....
here i am loading a program into richtext box
but in the richtextbox contain, white space between lines, so how will remove this ..
example
#include
int main()
{
(space)int a,b;
}
i want to remove i show in above code(space) not space between int and main.
Felipe RamosRank #1,409 · 1.2K reputationPosted Sep 30, 2010, 10:40 AM EDT
vishnu krishnan103 reputationPosted Sep 30, 2010, 11:33 AM EDT
vishnu krishnan103 reputationPosted Sep 30, 2010, 11:52 AM EDT