473,378 Members | 1,510 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Case-Insensitive String Replace

I am parsing a lot of files and need to replace a couple of string
variables, but the string.Replace(string,string) method won't work
because it is case-sensitive.
What would be the best way to do this?

I did find this article:
http://www.codeproject.com/csharp/Fa...sStringRep.asp

What is everyone else doing?

Jun 13 '06 #1
4 14953
Hi,
The article is very good, I would go with it.
--
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"INeedADip" <in*******@gmail.com> wrote in message
news:11**********************@h76g2000cwa.googlegr oups.com...
I am parsing a lot of files and need to replace a couple of string
variables, but the string.Replace(string,string) method won't work
because it is case-sensitive.
What would be the best way to do this?

I did find this article:
http://www.codeproject.com/csharp/Fa...sStringRep.asp

What is everyone else doing?

Jun 13 '06 #2
INeedADip wrote:
I am parsing a lot of files and need to replace a couple of string
variables, but the string.Replace(string,string) method won't work
because it is case-sensitive.
What would be the best way to do this?

I did find this article:
http://www.codeproject.com/csharp/Fa...sStringRep.asp

What is everyone else doing?


Have you looked at Regex.Replace() yet? It can be configured to be
case-insensitive.

hth,
Max
Jun 13 '06 #3
Markus Stoeger wrote:

Have you looked at Regex.Replace() yet? It can be configured to be
case-insensitive.

hth,
Max


Can you show an example? The help file doesn't show much.

Thanks.
--

Don Gollahon
do**********@acs-inc.com
Jun 28 '06 #4
Don Gollahon wrote:
Markus Stoeger wrote:

Have you looked at Regex.Replace() yet? It can be configured to be
case-insensitive.

hth,
Max


Can you show an example? The help file doesn't show much.

Thanks.


Never mind. I got figured it out.

--

Don Gollahon
do**********@acs-inc.com
Jun 28 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: ST | last post by:
Hi, I'm trying to debug someone else's code, and I'm going thru this Select Case statement. I'm having problems with the "OTHER" case...in that when the first line of the case is false, it jumps...
2
by: cs168 | last post by:
Hi I am new in ASP programming so I do use the very basic and simple way to do all my stuff. Now I do really got stuck at how can I loop thru the calculation for all my selection.. My full code is as...
6
by: deanfamily11 | last post by:
I've set up a case statement to have my program determine where on the Cartesian plane a point the user enters is located. I keep getting the C2051 error when I compile. Any help? #include...
10
by: MLH | last post by:
Suppose the following... Dim A as Date A=#7/24/2005# I wish to compare value of A against 2 other values: 1) 8/1/2005 2) 9/1/2005 Which is better and why... First:
7
by: Lauren Quantrell | last post by:
Is there any speed/resource advantage/disadvantage in using Select Case x Case 1 Case 2 etc. many more cases... End Select VS.
10
by: Chih-Hsu Yen | last post by:
I encountered a strange problem about switch-case statement. switch(cmd) { case 1: statements; break; case 2: statements; break; ... .... case 11: S1; S2; S3; statements;
5
by: Frederick Dean | last post by:
Hi,guys! I'm reading Stephen Dewhurst's book "C++ Gotchas"£¬in gothca #7, I meet a weird case: bool Postorder::next() { switch (pc) case START: while (true) if (!child()) { pc = LEAF; return...
21
by: markpapadakis | last post by:
I was checking out the C-FAQ and read here ( http://c-faq.com/misc/nonconstcase.html ) that: " case labels are limited to single, constant, integral expression ". However, I have been using...
22
by: John | last post by:
Hi Folks, I'm experimenting a little with creating a custom CEdit control so that I can decide on what the user is allowed to type into the control. I started off only allowing floating point...
24
by: clockworx05 | last post by:
Hey guys i have this program that i need to write for class. here are the instructions: Write a function called foo that asks the user for their age. Pass the age value to a function called...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.