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

C#

 
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 
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 
Something like this would do the trick.

String oldString = "I have a Computer Box on my desk";
String searchTerm = "computer box";
String replacement = "Computer System";
// case insensitive search
int idx = oldString.IndexOf(searchTerm, StringComparison.CurrentCultureIgnoreCase);
if (idx != -1) {
  // split to remove the undesired substring
  String frontEnd = oldString.Substring(0, idx);
  String backEnd = oldString.Substring(idx + searchTerm.Length);
  // recombine with the replacement string
  String newString = frontEnd + replacement + backEnd;
  Console.WriteLine(oldString);
  Console.WriteLine(newString);
} else {
  Console.WriteLine("Search term not found: {0}", searchTerm);
}


Alan.
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 
QuestionAdd horizontal and vertical bar into pictureBox? Pin
thucbv28-Oct-08 23:16
thucbv28-Oct-08 23:16 
QuestionInstalling my app using C# Pin
Pedram Behroozi28-Oct-08 23:15
Pedram Behroozi28-Oct-08 23:15 
AnswerRe: Installing my app using C# Pin
SeMartens28-Oct-08 23:19
SeMartens28-Oct-08 23:19 
QuestionWhich windows vista version is better for .net developer. Pin
VenkataRamana.Gali28-Oct-08 23:03
VenkataRamana.Gali28-Oct-08 23:03 

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.