Click here to Skip to main content
15,895,370 members
Home / Discussions / C#
   

C#

 
AnswerRe: xml Pin
Guffa29-Oct-08 8:29
Guffa29-Oct-08 8:29 
GeneralRe: xml Pin
arkiboys29-Oct-08 21:47
arkiboys29-Oct-08 21:47 
GeneralRe: xml Pin
Guffa30-Oct-08 9:58
Guffa30-Oct-08 9:58 
GeneralRe: xml Pin
arkiboys30-Oct-08 11:48
arkiboys30-Oct-08 11:48 
AnswerRe: xml Pin
Guffa30-Oct-08 15:32
Guffa30-Oct-08 15:32 
GeneralRe: xml Pin
arkiboys31-Oct-08 4:28
arkiboys31-Oct-08 4:28 
QuestionTab Pin
boiDev29-Oct-08 3:00
boiDev29-Oct-08 3:00 
QuestionReplace Pin
arkiboys29-Oct-08 1:45
arkiboys29-Oct-08 1:45 
I would like to replace the word "Computer Box" to "Computer System" in any sentence i.e. strSentence

string strSentence = "I have a Computer Box";
The string above could be = "I have a computer boc";
Notice the upper case "C" and "b" in computer.


So no matter what the case is in the word, I would like to replace just that word and nothing else in the sentence should change their existing case.

Input:
string strSentence = "I have a Computer Box";

Result:
strSentence = "I have a Computer System"
///////////////////////////
Input:
string strSentence = "I have a computer box";

Result:
strSentence = "I have a Computer System"

This does not seem to be the solution:
strSentence = strSentence.Replace("Computer Box", "Computer System")

The above code works if the case matches, but what if the word is written as "computer box"?
How can the above replace be altere to cater for any case.
Please note that I even tried ToLower(), but that changes everything in the sentence to lower which is not what I want.
Any thoughts please?
Thanks
AnswerRe: Replace Pin
Simon P Stevens29-Oct-08 1:58
Simon P Stevens29-Oct-08 1:58 
AnswerRe: Replace Pin
EliottA29-Oct-08 2:59
EliottA29-Oct-08 2:59 
GeneralRe: Replace [modified] Pin
arkiboys29-Oct-08 10:29
arkiboys29-Oct-08 10:29 
AnswerRe: Replace Pin
Alan N29-Oct-08 3:19
Alan N29-Oct-08 3:19 
QuestionCan I store raw binary data space-efficiently in a .cs file? Pin
arnold_w29-Oct-08 1:38
arnold_w29-Oct-08 1:38 
AnswerRe: Can I store raw binary data space-efficiently in a .cs file? Pin
Simon P Stevens29-Oct-08 1:50
Simon P Stevens29-Oct-08 1:50 
GeneralRe: Can I store raw binary data space-efficiently in a .cs file? Pin
arnold_w29-Oct-08 1:52
arnold_w29-Oct-08 1:52 
GeneralRe: Can I store raw binary data space-efficiently in a .cs file? Pin
Simon P Stevens29-Oct-08 2:07
Simon P Stevens29-Oct-08 2:07 
GeneralRe: Can I store raw binary data space-efficiently in a .cs file? Pin
arnold_w29-Oct-08 2:13
arnold_w29-Oct-08 2:13 
GeneralRe: Can I store raw binary data space-efficiently in a .cs file? Pin
Simon P Stevens29-Oct-08 2:23
Simon P Stevens29-Oct-08 2:23 
GeneralRe: Can I store raw binary data space-efficiently in a .cs file? Pin
arnold_w29-Oct-08 2:45
arnold_w29-Oct-08 2:45 
GeneralRe: Can I store raw binary data space-efficiently in a .cs file? Pin
PIEBALDconsult29-Oct-08 5:00
mvePIEBALDconsult29-Oct-08 5:00 
AnswerRe: Can I store raw binary data space-efficiently in a .cs file? Pin
Luc Pattyn29-Oct-08 2:12
sitebuilderLuc Pattyn29-Oct-08 2:12 
GeneralRe: Can I store raw binary data space-efficiently in a .cs file? Pin
arnold_w29-Oct-08 2:14
arnold_w29-Oct-08 2:14 
AnswerRe: Can I store raw binary data space-efficiently in a .cs file? Pin
Mirko198029-Oct-08 6:26
Mirko198029-Oct-08 6:26 
GeneralRe: Can I store raw binary data space-efficiently in a .cs file? Pin
arnold_w30-Oct-08 1:09
arnold_w30-Oct-08 1:09 
QuestionExcel automation in web application Pin
DJ24528-Oct-08 23:22
DJ24528-Oct-08 23:22 

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.