Click here to Skip to main content
15,896,557 members
Home / Discussions / C#
   

C#

 
GeneralRe: calling base-constructor Pin
jparsons5-Sep-02 12:19
jparsons5-Sep-02 12:19 
GeneralDrag and Drop into a node of a treeview Pin
Bill Dean4-Sep-02 11:36
Bill Dean4-Sep-02 11:36 
GeneralRe: Drag and Drop into a node of a treeview Pin
Ryan Cromwell5-Sep-02 2:49
Ryan Cromwell5-Sep-02 2:49 
GeneralRe: Drag and Drop into a node of a treeview Pin
Bill Dean5-Sep-02 4:19
Bill Dean5-Sep-02 4:19 
GeneralParameters question Pin
leppie4-Sep-02 10:29
leppie4-Sep-02 10:29 
GeneralRe: Parameters question Pin
jparsons5-Sep-02 2:59
jparsons5-Sep-02 2:59 
GeneralRe: Parameters question Pin
leppie5-Sep-02 3:13
leppie5-Sep-02 3:13 
QuestionReplace with a C# Regex? Pin
Zombies with Coffee, LLC4-Sep-02 9:25
professionalZombies with Coffee, LLC4-Sep-02 9:25 
I am using regex (regular expressions) in my C# application. I am pulling out the first name like this...

Regex regName = new Regex( @"(?<Last>\S+), (?<First>\S+)" );
Match pMatch  = regName.Match( "Doe, John" );
Text strFirst = pMatch.Groups[ "First" ].Value;


Question: If the user changes the name to 'Jane', how can I use regular expressions to replace the first name?

If strFirst = "Jane", then I want a new string to be "Doe, Jane".

Thanks!!
AnswerRe: Replace with a C# Regex? Pin
Eric Gunnerson (msft)4-Sep-02 10:17
Eric Gunnerson (msft)4-Sep-02 10:17 
GeneralClickety Pin
David Stone4-Sep-02 12:20
sitebuilderDavid Stone4-Sep-02 12:20 
GeneralUnsafe Question Pin
Nick Parker4-Sep-02 9:24
protectorNick Parker4-Sep-02 9:24 
GeneralRe: Unsafe Question Pin
leppie4-Sep-02 9:39
leppie4-Sep-02 9:39 
GeneralRe: Unsafe Question Pin
Nick Parker4-Sep-02 9:43
protectorNick Parker4-Sep-02 9:43 
GeneralOptional parameters Pin
Nnamdi Onyeyiri4-Sep-02 8:21
Nnamdi Onyeyiri4-Sep-02 8:21 
GeneralRe: Optional parameters Pin
Nick Parker4-Sep-02 8:56
protectorNick Parker4-Sep-02 8:56 
GeneralRe: Optional parameters Pin
leppie4-Sep-02 9:33
leppie4-Sep-02 9:33 
GeneralRe: Optional parameters Pin
Nick Parker4-Sep-02 9:44
protectorNick Parker4-Sep-02 9:44 
GeneralRe: Optional parameters Pin
Eric Gunnerson (msft)4-Sep-02 10:10
Eric Gunnerson (msft)4-Sep-02 10:10 
GeneralRe: Optional parameters Pin
leppie4-Sep-02 10:18
leppie4-Sep-02 10:18 
GeneralRe: Optional parameters Pin
David Stone4-Sep-02 12:22
sitebuilderDavid Stone4-Sep-02 12:22 
GeneralRe: Optional parameters Pin
Paul Riley4-Sep-02 12:21
Paul Riley4-Sep-02 12:21 
GeneralRe: Optional parameters Pin
Nick Parker5-Sep-02 2:59
protectorNick Parker5-Sep-02 2:59 
GeneralRe: Optional parameters Pin
leppie4-Sep-02 13:20
leppie4-Sep-02 13:20 
GeneralRe: Optional parameters Pin
Paul Riley5-Sep-02 2:10
Paul Riley5-Sep-02 2:10 
GeneralRe: Optional parameters Pin
leppie5-Sep-02 2:24
leppie5-Sep-02 2:24 

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.