Click here to Skip to main content
15,915,019 members
Home / Discussions / C#
   

C#

 
GeneralRe: unknown exception thrown when decrypting read-in message Pin
Heath Stewart22-Mar-04 3:17
protectorHeath Stewart22-Mar-04 3:17 
GeneralRe: unknown exception thrown when decrypting read-in message Pin
Heath Stewart22-Mar-04 3:23
protectorHeath Stewart22-Mar-04 3:23 
GeneralRe: unknown exception thrown when decrypting read-in message Pin
chau_fai_rubbish22-Mar-04 15:00
chau_fai_rubbish22-Mar-04 15:00 
GeneralRe: unknown exception thrown when decrypting read-in message Pin
Heath Stewart23-Mar-04 2:56
protectorHeath Stewart23-Mar-04 2:56 
GeneralRe: unknown exception thrown when decrypting read-in message Pin
terry_cyf23-Mar-04 20:40
terry_cyf23-Mar-04 20:40 
GeneralRe: unknown exception thrown when decrypting read-in message Pin
Heath Stewart24-Mar-04 2:46
protectorHeath Stewart24-Mar-04 2:46 
GeneralFormatting Strings Pin
Maharishi Bhatia21-Mar-04 18:35
Maharishi Bhatia21-Mar-04 18:35 
GeneralRe: Formatting Strings Pin
Heath Stewart21-Mar-04 18:56
protectorHeath Stewart21-Mar-04 18:56 
Never concatenate strings using + - it's very expensive since two iterations for each string and each concatenation are necessary, making it an (m-1)O(2n) operation where n is the number of character for two strings and m is the number of strings.

Use String.Concat or String.Format like you're doing, but don't use ToString. What do you thing String.Format is for? Lets say you wanted to format the date using the long date format. Just use the following:
string s = string.Format("The date is {0:D}.", DateTime.Now);
If you use ToString, you loose that ability (unless you use the overload for DateTime.ToString which takes a string and optionally a different culture's IFormatProvider. I'll be submitting an article on this topic in the next couple days. You might want to keep a look out and read it.

 

Microsoft MVP, Visual C#
My Articles
GeneralRe: Formatting Strings Pin
Spanky321-Mar-04 21:12
Spanky321-Mar-04 21:12 
GeneralRe: Formatting Strings Pin
Heath Stewart22-Mar-04 3:09
protectorHeath Stewart22-Mar-04 3:09 
GeneralRe: Formatting Strings Pin
Judah Gabriel Himango22-Mar-04 4:01
sponsorJudah Gabriel Himango22-Mar-04 4:01 
GeneralRe: Formatting Strings Pin
Heath Stewart22-Mar-04 4:11
protectorHeath Stewart22-Mar-04 4:11 
GeneralRe: Formatting Strings Pin
Alvaro Mendez22-Mar-04 10:08
Alvaro Mendez22-Mar-04 10:08 
GeneralRe: Formatting Strings Pin
Heath Stewart22-Mar-04 11:45
protectorHeath Stewart22-Mar-04 11:45 
GeneralRe: Formatting Strings Pin
Alvaro Mendez22-Mar-04 10:34
Alvaro Mendez22-Mar-04 10:34 
Generalclipboard Pin
cmarmr21-Mar-04 16:49
cmarmr21-Mar-04 16:49 
GeneralRe: clipboard Pin
Heath Stewart21-Mar-04 18:51
protectorHeath Stewart21-Mar-04 18:51 
GeneralRe: clipboard Pin
cmarmr22-Mar-04 9:45
cmarmr22-Mar-04 9:45 
GeneralRe: clipboard Pin
Heath Stewart22-Mar-04 9:52
protectorHeath Stewart22-Mar-04 9:52 
GeneralRe: clipboard Pin
cmarmr23-Mar-04 3:47
cmarmr23-Mar-04 3:47 
Generalanyone help me!! Pin
lcsnatoo21-Mar-04 16:05
lcsnatoo21-Mar-04 16:05 
GeneralRe: anyone help me!! Pin
Heath Stewart21-Mar-04 18:46
protectorHeath Stewart21-Mar-04 18:46 
Questioncode to keep checking the OS if connected to the net? Pin
User 96257821-Mar-04 14:06
User 96257821-Mar-04 14:06 
AnswerRe: code to keep checking the OS if connected to the net? Pin
Spanky321-Mar-04 21:16
Spanky321-Mar-04 21:16 
GeneralRe: code to keep checking the OS if connected to the net? Pin
User 96257822-Mar-04 6:45
User 96257822-Mar-04 6:45 

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.