Click here to Skip to main content
15,890,185 members
Home / Discussions / C#
   

C#

 
AnswerRe: Restrict Access To DLL Pin
Not Active24-Nov-10 8:37
mentorNot Active24-Nov-10 8:37 
GeneralRe: Restrict Access To DLL Pin
Kevin Marois24-Nov-10 8:39
professionalKevin Marois24-Nov-10 8:39 
AnswerRe: Restrict Access To DLL Pin
PIEBALDconsult24-Nov-10 9:01
mvePIEBALDconsult24-Nov-10 9:01 
GeneralRe: Restrict Access To DLL Pin
Kevin Marois24-Nov-10 10:38
professionalKevin Marois24-Nov-10 10:38 
GeneralRe: Restrict Access To DLL Pin
PIEBALDconsult24-Nov-10 10:41
mvePIEBALDconsult24-Nov-10 10:41 
GeneralRe: Restrict Access To DLL Pin
AspDotNetDev24-Nov-10 11:19
protectorAspDotNetDev24-Nov-10 11:19 
AnswerRe: Restrict Access To DLL Pin
Luc Pattyn24-Nov-10 12:36
sitebuilderLuc Pattyn24-Nov-10 12:36 
QuestionHow can I make a line.Contains(searchString) case insensitive? Pin
turbosupramk324-Nov-10 2:00
turbosupramk324-Nov-10 2:00 
I've been trying to figure this out for over an hour and haven't had any luck. While doing a string comparison, this works but is case sensitive ... I'd like to make it case insensitive, any ideas on how to do this?



while ((line = file.ReadLine()) != null)
                   {

                      if (line.Contains(searchString))
                       {

                           textBox12.Text += "Line Number " + counter.ToString() + ":" + "\r\n";
                           textBox12.Text += line + "\r\n";
                           textBox12.Text += "\r\n";

                       }

                       counter++;
                   }



Complete function

if (checkBox1.Checked == false)
{
    foreach (string i in xmlFileNames)
    {
        FileStream fs = new FileStream(@i, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
        StreamReader xmlStream = new StreamReader(@i);
        XmlDocument xmlDoc = new XmlDocument();
        xmlDoc.Load(fs);
        string allRead = xmlStream.ReadToEnd();
        string line = null;
        int counter = 0;
        string testString = Regex.Match(allRead, searchString, RegexOptions.IgnoreCase).ToString();
        if(Regex.Match(allRead, searchString, RegexOptions.IgnoreCase).Success == true)
        {
            System.IO.StreamReader file = new System.IO.StreamReader(@i);
            while ((line = file.ReadLine()) != null)
            {

                if (line.Contains(searchString))
                {

                    textBox12.Text += "Line Number " + counter.ToString() + ":" + "\r\n";
                    textBox12.Text += line + "\r\n";
                    textBox12.Text += "\r\n";
                }

                counter++;
            }

        }
        xmlStream.Close();
    }
    textBox12.AppendText("Number of xmls listed: " + xmlFileNames.Count().ToString());
}

AnswerRe: How can I make a line.Contains(searchString) case insensitive? Pin
J4amieC24-Nov-10 2:09
J4amieC24-Nov-10 2:09 
GeneralRe: How can I make a line.Contains(searchString) case insensitive? Pin
turbosupramk324-Nov-10 2:23
turbosupramk324-Nov-10 2:23 
AnswerRe: How can I make a line.Contains(searchString) case insensitive? Pin
PIEBALDconsult24-Nov-10 2:10
mvePIEBALDconsult24-Nov-10 2:10 
GeneralRe: How can I make a line.Contains(searchString) case insensitive? Pin
J4amieC24-Nov-10 4:01
J4amieC24-Nov-10 4:01 
GeneralRe: How can I make a line.Contains(searchString) case insensitive? Pin
PIEBALDconsult24-Nov-10 13:47
mvePIEBALDconsult24-Nov-10 13:47 
AnswerRe: How can I make a line.Contains(searchString) case insensitive? Pin
Manfred Rudolf Bihy24-Nov-10 2:27
professionalManfred Rudolf Bihy24-Nov-10 2:27 
GeneralRe: How can I make a line.Contains(searchString) case insensitive? Pin
Luc Pattyn24-Nov-10 3:31
sitebuilderLuc Pattyn24-Nov-10 3:31 
GeneralRe: How can I make a line.Contains(searchString) case insensitive? Pin
J4amieC24-Nov-10 4:04
J4amieC24-Nov-10 4:04 
GeneralRe: How can I make a line.Contains(searchString) case insensitive? Pin
Manfred Rudolf Bihy24-Nov-10 4:06
professionalManfred Rudolf Bihy24-Nov-10 4:06 
AnswerRe: How can I make a line.Contains(searchString) case insensitive? Pin
#realJSOP24-Nov-10 23:59
mve#realJSOP24-Nov-10 23:59 
QuestionSaving stream from IP camera Pin
koleraba24-Nov-10 0:59
koleraba24-Nov-10 0:59 
AnswerRe: Saving stream from IP camera Pin
JF201524-Nov-10 1:15
JF201524-Nov-10 1:15 
GeneralRe: Saving stream from IP camera Pin
koleraba24-Nov-10 2:09
koleraba24-Nov-10 2:09 
QuestionHow to manage city,state and country fields in drop down online Pin
sumit703423-Nov-10 23:01
sumit703423-Nov-10 23:01 
AnswerRe: How to manage city,state and country fields in drop down online Pin
J4amieC23-Nov-10 23:20
J4amieC23-Nov-10 23:20 
GeneralRe: How to manage city,state and country fields in drop down online Pin
sumit703423-Nov-10 23:28
sumit703423-Nov-10 23:28 
AnswerRe: How to manage city,state and country fields in drop down online Pin
PIEBALDconsult24-Nov-10 16:05
mvePIEBALDconsult24-Nov-10 16:05 

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.