Click here to Skip to main content
15,888,061 members
Home / Discussions / C#
   

C#

 
AnswerRe: MaskedTextBox Pin
Patrick Etc.24-Apr-07 6:18
Patrick Etc.24-Apr-07 6:18 
QuestionMenus at run time [modified] Pin
a_david12323-Apr-07 19:51
a_david12323-Apr-07 19:51 
QuestionExtract ClassName using Regular Expression Pin
nasambur23-Apr-07 19:25
nasambur23-Apr-07 19:25 
QuestionReading a specific word/phrase from a line Pin
zoroyster23-Apr-07 17:25
zoroyster23-Apr-07 17:25 
AnswerRe: Reading a specific word/phrase from a line Pin
Patrick Etc.23-Apr-07 17:31
Patrick Etc.23-Apr-07 17:31 
GeneralRe: Reading a specific word/phrase from a line Pin
xibeifeijian23-Apr-07 18:25
xibeifeijian23-Apr-07 18:25 
GeneralRe: Reading a specific word/phrase from a line Pin
Patrick Etc.23-Apr-07 18:34
Patrick Etc.23-Apr-07 18:34 
GeneralRe: Reading a specific word/phrase from a line Pin
zoroyster23-Apr-07 19:35
zoroyster23-Apr-07 19:35 
Patrick Sears wrote:
If you can rely on a standard line format, it's pretty easy:

string line = "Name: Joseph Smith";

string[] parts = string.split(line, ":");

Then the parts[] array will contain the following strings:

parts[0] = "Name"
parts[1] = " Joseph Smith"

Note the space before Joseph. You could use string.Trim() to get rid of that, or you can modify the split to use StringSplitOptions.RemoveEmptyEntries.

I'm assuming you're using C#, here.

------------
Cheers,
Patrick


Hi Patrick! thanks for the help. Yes, im using C#, but i received this error

"Error 1 'string' does not contain a definition for 'split'" for string[] parts = string.split(line, ":");

do i need to import something?

thanks again
GeneralRe: Reading a specific word/phrase from a line Pin
xibeifeijian23-Apr-07 19:44
xibeifeijian23-Apr-07 19:44 
GeneralRe: Reading a specific word/phrase from a line Pin
Patrick Etc.24-Apr-07 6:00
Patrick Etc.24-Apr-07 6:00 
QuestionHow to impose Expire Date on MS Office files? [modified] Pin
sachinkalse23-Apr-07 17:21
sachinkalse23-Apr-07 17:21 
AnswerRe: How to impose Expire Date on MS Office files? Pin
Russell Jones24-Apr-07 0:04
Russell Jones24-Apr-07 0:04 
GeneralRe: How to impose Expire Date on MS Office files? [modified] Pin
sachinkalse13-Jun-07 16:36
sachinkalse13-Jun-07 16:36 
QuestionVery basic help with C++ linker/logic errors Pin
wertyou23-Apr-07 17:05
wertyou23-Apr-07 17:05 
AnswerRe: Very basic help with C++ linker/logic errors Pin
Patrick Etc.23-Apr-07 17:27
Patrick Etc.23-Apr-07 17:27 
GeneralRe: Very basic help with C++ linker/logic errors Pin
wertyou23-Apr-07 17:37
wertyou23-Apr-07 17:37 
GeneralRe: Very basic help with C++ linker/logic errors Pin
Patrick Etc.23-Apr-07 17:45
Patrick Etc.23-Apr-07 17:45 
GeneralRe: Very basic help with C++ linker/logic errors Pin
wertyou23-Apr-07 18:04
wertyou23-Apr-07 18:04 
GeneralRe: Very basic help with C++ linker/logic errors Pin
Patrick Etc.23-Apr-07 18:27
Patrick Etc.23-Apr-07 18:27 
GeneralRe: Very basic help with C++ linker/logic errors Pin
wertyou23-Apr-07 18:42
wertyou23-Apr-07 18:42 
GeneralRe: Very basic help with C++ linker/logic errors Pin
Patrick Etc.23-Apr-07 18:45
Patrick Etc.23-Apr-07 18:45 
GeneralRe: Very basic help with C++ linker/logic errors Pin
wertyou24-Apr-07 14:53
wertyou24-Apr-07 14:53 
GeneralRe: Very basic help with C++ linker/logic errors Pin
Patrick Etc.24-Apr-07 15:09
Patrick Etc.24-Apr-07 15:09 
GeneralRe: Very basic help with C++ linker/logic errors Pin
wertyou24-Apr-07 15:30
wertyou24-Apr-07 15:30 
GeneralRe: Very basic help with C++ linker/logic errors Pin
Patrick Etc.24-Apr-07 15:49
Patrick Etc.24-Apr-07 15:49 

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.