Click here to Skip to main content
15,924,829 members
Home / Discussions / C#
   

C#

 
AnswerRe: Write Dataset to SQL Pin
Giorgi Dalakishvili22-Aug-07 5:01
mentorGiorgi Dalakishvili22-Aug-07 5:01 
Questionstring.IndexOf help Pin
solutionsville22-Aug-07 3:28
solutionsville22-Aug-07 3:28 
AnswerRe: string.IndexOf help Pin
Martin#22-Aug-07 3:45
Martin#22-Aug-07 3:45 
GeneralRe: string.IndexOf help Pin
solutionsville22-Aug-07 4:06
solutionsville22-Aug-07 4:06 
GeneralRe: string.IndexOf help Pin
Martin#22-Aug-07 4:30
Martin#22-Aug-07 4:30 
GeneralRe: string.IndexOf help Pin
solutionsville22-Aug-07 4:43
solutionsville22-Aug-07 4:43 
GeneralRe: string.IndexOf help Pin
Martin#22-Aug-07 4:47
Martin#22-Aug-07 4:47 
AnswerRe: string.IndexOf help Pin
Justin Perez22-Aug-07 3:46
Justin Perez22-Aug-07 3:46 
solutionsville wrote:
Lets say I want to search for and display every line that has the word "one" in it and then display it in a RichTextBox


Here's how you can use IndexOf()

<br />
int hasOne;<br />
<br />
string strWorkString = string.Empty;<br />
strWorkString = "one plus 3";<br />
<br />
hasOne = strWorkString.IndexOf("one");<br />


That will report where in the string "one" is found. Also,

solutionsville wrote:
MessageBox.Show("String: " + txtSearchTerm.Text.ToString() + " not found", "No Matches", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);


When you do that, you should really use string.Format(). Do it like so:

<br />
MessageBox.Show(string.Format("String: {0} not found", txtSearchTerm.Text.ToString()), "No Matches", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);<br />




I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")

QuestionC# DATE FORMAT Pin
KETAN.RK22-Aug-07 3:09
KETAN.RK22-Aug-07 3:09 
AnswerRe: C# DATE FORMAT Pin
J4amieC22-Aug-07 3:10
J4amieC22-Aug-07 3:10 
GeneralRe: C# DATE FORMAT Pin
KETAN.RK22-Aug-07 5:01
KETAN.RK22-Aug-07 5:01 
GeneralRe: C# DATE FORMAT Pin
J4amieC22-Aug-07 5:56
J4amieC22-Aug-07 5:56 
AnswerRe: C# DATE FORMAT Pin
Levon Nalbandyan22-Aug-07 3:32
Levon Nalbandyan22-Aug-07 3:32 
Questiontooltips Pin
Sunshine Always22-Aug-07 2:11
Sunshine Always22-Aug-07 2:11 
AnswerRe: tooltips Pin
SpiveyC#22-Aug-07 3:45
SpiveyC#22-Aug-07 3:45 
GeneralRe: tooltips Pin
Sunshine Always22-Aug-07 3:58
Sunshine Always22-Aug-07 3:58 
GeneralRe: tooltips Pin
Luc Pattyn22-Aug-07 4:20
sitebuilderLuc Pattyn22-Aug-07 4:20 
QuestionWierd req from boss Pin
SpiveyC#22-Aug-07 2:10
SpiveyC#22-Aug-07 2:10 
AnswerRe: Wierd req from boss Pin
Giorgi Dalakishvili22-Aug-07 2:12
mentorGiorgi Dalakishvili22-Aug-07 2:12 
GeneralRe: Wierd req from boss Pin
PIEBALDconsult22-Aug-07 5:12
mvePIEBALDconsult22-Aug-07 5:12 
GeneralRe: Wierd req from boss Pin
Dan Neely22-Aug-07 5:37
Dan Neely22-Aug-07 5:37 
GeneralRe: Wierd req from boss Pin
PIEBALDconsult22-Aug-07 5:58
mvePIEBALDconsult22-Aug-07 5:58 
AnswerRe: Wierd req from boss Pin
Rocky#22-Aug-07 2:21
Rocky#22-Aug-07 2:21 
GeneralRe: Wierd req from boss Pin
SpiveyC#22-Aug-07 3:42
SpiveyC#22-Aug-07 3:42 
GeneralRe: Wierd req from boss Pin
Rocky#22-Aug-07 19:16
Rocky#22-Aug-07 19:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.