Re: Is there a performance difference between TextWriter.WriteLine(String) and TextWriteLine(String, array<Object>[])?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



"Author" <gnewsgroup@xxxxxxxxx> wrote:

OK, thank you very much. Just curious, why do they introduce the second
version (the one using String.Format), which is sorta like the tradtional
C syntax of printf?

You might want to store the format template somewhere.

For example, consider messages that need to be translated into different
languages with different word order:

"{0} caused a {1} error"
"Une erreur du type {1} s'est produite dans {0}"

Then you can use the same String.Format call with the same parameters.

Eq.


.



Relevant Pages

  • Re: configure an awk program from file?
    ... Strip the script down to make it clearer: ... printf "\tAufwendungen:\n" ... You can re-write that with condition-action syntax as: ... You can force the "else" implementation with condition-action syntax by using a "next": ...
    (comp.lang.awk)
  • Re: Too much code - slicing
    ... I'd rarely use "I'll go to the store if I have time, ... it always breaks my parser. ... And then the one I'm used to from other languages: ... a syntax error in Python -- I can't use postfix if to modify a sentence, ...
    (comp.lang.python)
  • Re: Crash Course To The Roguelike Development
    ... I really like its syntax. ... I think it may be the only language ... centaur store ogre store gargoyle store ... dup 1 guardian atleast? ...
    (rec.games.roguelike.development)
  • Re: English-like Python
    ... requires no extra syntax "). ... Except that now you have introduced an inconsistency into python. ... x= going to the store ... you usually make declarations ...
    (comp.lang.python)
  • Re: What is wrong with my program?
    ... int main ... don't store any number when the return value of randis already ... Thus the printf loop prints ... Causing the printf statement to print something else? ...
    (comp.lang.c)