Click here to Skip to main content
15,904,416 members
Home / Discussions / C#
   

C#

 
AnswerRe: MS Agent speech related Pin
Thomas Stockwell29-Oct-08 6:23
professionalThomas Stockwell29-Oct-08 6:23 
QuestionUnit testing for DevExpress Pin
J-Cod3r29-Oct-08 4:07
J-Cod3r29-Oct-08 4:07 
AnswerRe: Unit testing for DevExpress Pin
Kevin McFarlane29-Oct-08 5:47
Kevin McFarlane29-Oct-08 5:47 
GeneralRe: Unit testing for DevExpress Pin
J-Cod3r29-Oct-08 20:26
J-Cod3r29-Oct-08 20:26 
AnswerRe: Unit testing for DevExpress Pin
N a v a n e e t h29-Oct-08 18:35
N a v a n e e t h29-Oct-08 18:35 
AnswerRe: Unit testing for DevExpress Pin
Dennis Garavsky7-Jul-11 5:21
Dennis Garavsky7-Jul-11 5:21 
Questionxml Pin
arkiboys29-Oct-08 3:28
arkiboys29-Oct-08 3:28 
AnswerRe: xml Pin
SeMartens29-Oct-08 3:39
SeMartens29-Oct-08 3:39 
GeneralRe: xml Pin
arkiboys29-Oct-08 4:40
arkiboys29-Oct-08 4:40 
GeneralRe: xml Pin
PIEBALDconsult29-Oct-08 4:54
mvePIEBALDconsult29-Oct-08 4:54 
GeneralRe: xml Pin
Andrew Rissing29-Oct-08 8:28
Andrew Rissing29-Oct-08 8:28 
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 
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 

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.