Click here to Skip to main content
15,910,303 members
Home / Discussions / C#
   

C#

 
GeneralWindows Form Designer Woes Pin
Nnamdi Onyeyiri22-Aug-02 9:22
Nnamdi Onyeyiri22-Aug-02 9:22 
GeneralGetting Autonumber field value Pin
Luis Alonso Ramos22-Aug-02 8:53
Luis Alonso Ramos22-Aug-02 8:53 
GeneralChanging an object's display value Pin
leppie22-Aug-02 8:51
leppie22-Aug-02 8:51 
GeneralRe: Changing an object's display value Pin
David Stone22-Aug-02 10:05
sitebuilderDavid Stone22-Aug-02 10:05 
GeneralRe: Changing an object's display value Pin
leppie22-Aug-02 11:07
leppie22-Aug-02 11:07 
GeneralRe: Changing an object's display value Pin
James T. Johnson22-Aug-02 12:19
James T. Johnson22-Aug-02 12:19 
GeneralRe: Changing an object's display value Pin
David Stone22-Aug-02 12:58
sitebuilderDavid Stone22-Aug-02 12:58 
GeneralGUID & String Replacing Pin
MStanbrook22-Aug-02 8:37
MStanbrook22-Aug-02 8:37 
Confused | :confused:

I'm having a problem with a simple String "Replace"
I am passing in a GUID into the function (see code below).
The GUID includes "{-}" characters. The function below should strip those chars,
but it is returning the original string.

Any suggestions? tia.


private string StripPunctuation(string sourceString )
 {
   int counter;
   string PunctuationCharacters;
   string buffer = sourceString;
   int StringLength;

   //Initialize the Lookup String
   PunctuationCharacters = "`!@$%^*()+=\\|[]{};:<>/?,~";
   StringLength = PunctuationCharacters.Length;
		
   //Trim the Source (just in case)
   buffer.Trim();
   try
   {
     for (counter = 1 ; counter < StringLength ; counter++)
     {
       buffer.Replace( PunctuationCharacters.Substring(counter, 1), "");
     }

     //Also remove double Quotes
     buffer.Replace((char) 34, (char) 0);

     return buffer;
   }
   catch
   {
     return sourceString;
   }
}


Mike Stanbrook
mstanbrook@yahoo.com
GeneralRe: GUID & String Replacing Pin
James T. Johnson22-Aug-02 9:34
James T. Johnson22-Aug-02 9:34 
GeneralRe: GUID & String Replacing Pin
MStanbrook22-Aug-02 11:39
MStanbrook22-Aug-02 11:39 
GeneralRe: GUID & String Replacing Pin
Domenic Denicola23-Aug-02 17:38
Domenic Denicola23-Aug-02 17:38 
GeneralRe: GUID & String Replacing Pin
MStanbrook26-Aug-02 4:49
MStanbrook26-Aug-02 4:49 
GeneralRe: GUID & String Replacing Pin
Domenic Denicola26-Aug-02 13:41
Domenic Denicola26-Aug-02 13:41 
GeneralMath question Pin
leppie22-Aug-02 7:24
leppie22-Aug-02 7:24 
GeneralRe: Math question Pin
David Stone22-Aug-02 7:55
sitebuilderDavid Stone22-Aug-02 7:55 
GeneralRe: Math question Pin
leppie22-Aug-02 8:03
leppie22-Aug-02 8:03 
GeneralRe: Math question Pin
Richard Deeming22-Aug-02 8:06
mveRichard Deeming22-Aug-02 8:06 
GeneralRe: Math question Pin
leppie22-Aug-02 8:16
leppie22-Aug-02 8:16 
GeneralRe: Math question Pin
Stephane Rodriguez.22-Aug-02 8:11
Stephane Rodriguez.22-Aug-02 8:11 
GeneralRe: Math question Pin
leppie22-Aug-02 9:19
leppie22-Aug-02 9:19 
GeneralNew developments :) Pin
leppie23-Aug-02 6:07
leppie23-Aug-02 6:07 
GeneralRe: New developments :) Pin
Stephane Rodriguez.23-Aug-02 6:58
Stephane Rodriguez.23-Aug-02 6:58 
GeneralRe: New developments :) Pin
leppie23-Aug-02 7:14
leppie23-Aug-02 7:14 
GeneralRe: New developments :) Pin
Stephane Rodriguez.23-Aug-02 7:49
Stephane Rodriguez.23-Aug-02 7:49 
GeneralRe: New developments :) Pin
leppie23-Aug-02 8:10
leppie23-Aug-02 8:10 

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.