Hello, all! I have question about String.Format method.
There are two variants: public static string Format(string, params
object[]); and public static string Format(IFormatProvider, string, params
object[]);
What happens if i will use String.Format("{0} and {1}", "one", "two")
instead of String.Format(System.Globalization.CultureInfo.Cur rentCulture,
"{0} and {1}", "one", "two")?
What differense between these two methods?
Then i use FxCop i have a lot of errors with this resolution: "The call to
'String.Format(String format, Object arg0)' does not explicitly provide
IFormatProvider. This should be replaced with a call to an overload that
does: String.Format(IFormatProvider provider, String format, Object[] args)"
Is this really Critical?
Thanks alot, Alex. 2 3980
san wrote: There are two variants: public static string Format(string, params object[]); and public static string Format(IFormatProvider, string, params object[]);
What happens if i will use String.Format("{0} and {1}", "one", "two") instead of String.Format(System.Globalization.CultureInfo.Cur rentCulture, "{0} and {1}", "one", "two")?
What differense between these two methods?
None :-)
Then i use FxCop i have a lot of errors with this resolution: "The call to 'String.Format(String format, Object arg0)' does not explicitly provide IFormatProvider. This should be replaced with a call to an overload that does: String.Format(IFormatProvider provider, String format, Object[] args)"
Is this really Critical?
It may not be critical, but it's nevertheless an important thing to
understand. I have searched Google and found an article for you that
explains things quite nicely: http://www.boyet.com/Articles/Specif...tProvider.html
Oliver Sturm
--
omnibus ex nihilo ducendis sufficit unum
Spaces inserted to prevent google email destruction:
MSN oliver @ sturmnet.org Jabber sturm @ amessage.de
ICQ 27142619 http://www.sturmnet.org/blog
Hi,
The IFormatProvider should be used when your application uses globalization
and different cultures.
In FXCop, you can disable this rule, so that it does not give any error if
you are not providing this parameter.
--
Saravanan K V
"san" wrote: Hello, all! I have question about String.Format method.
There are two variants: public static string Format(string, params object[]); and public static string Format(IFormatProvider, string, params object[]);
What happens if i will use String.Format("{0} and {1}", "one", "two") instead of String.Format(System.Globalization.CultureInfo.Cur rentCulture, "{0} and {1}", "one", "two")?
What differense between these two methods?
Then i use FxCop i have a lot of errors with this resolution: "The call to 'String.Format(String format, Object arg0)' does not explicitly provide IFormatProvider. This should be replaced with a call to an overload that does: String.Format(IFormatProvider provider, String format, Object[] args)"
Is this really Critical?
Thanks alot, Alex. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Bob |
last post by:
I'm having trouble the string.Format() throwing exceptions and I can't figure
out what I am doing wrong.
Given the following setup code:
string str = { "one", "two", "three", "four" };
double...
|
by: Alpha |
last post by:
Hi, I'm maintaining C# code and am fairly new with C# programming. I'm
looking for codes that's droping the 2nd digit of a nuber printed out and I
suspect it's the code below. Can someone tell me...
|
by: Dominique Vandensteen |
last post by:
after the very small & vs string.format discussion I did some speed tests...
loop of 1.000.000 concatenations of 5 public string variables in a class
gave following results:
result = a & b...
|
by: David Morris |
last post by:
Hi
Could somebody please explain what the following line of code means
String.Format("{0}\{1}.{2:00}", C:\, myfile.txt, 1
It's actually the first argument that I don't understand. What is...
|
by: nobody |
last post by:
I know that given a FormatString and a DateTime you can use
DateTime.ToString(...) to convert the DateTime to a String. My question is
how can you turn that around? Given a String and a...
|
by: L. Scott M. |
last post by:
Have a quick simple question:
dim x as string
x = "1234567890"
-------------------------------------------------------
VB 6
dim y as string
|
by: AMP |
last post by:
Hello,
I want to add some variables to a string and this isnt working.
textBox1.Text="'BSL version='+ bslVerHi+ bslVerLo";
What am I doing wrong?
Thanks
Mike
|
by: Lucky |
last post by:
hi guys!
back again with another query.
the problem is like this.
i want to print a line like this:
"---------------------------------------------"
the easiest way is to simply assign it to...
|
by: shawrie |
last post by:
Hello everyone can anyone please help me?
I basically want to set the length of a string variable to help
spacing my simple report out.
i tried
dim test as string(14)
but it didnt like that
|
by: jpenguin |
last post by:
I'm doing a simple program to learn java. I have the input and math parts right. It just isn't displaying right. It outputs a list of about 11 things-- with the format "string $ xx.xx"
In each...
|
by: lllomh |
last post by:
Define the method first
this.state = {
buttonBackgroundColor: 'green',
isBlinking: false, // A new status is added to identify whether the button is blinking or not
}
autoStart=()=>{
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM)
The start time is equivalent to 19:00 (7PM) in Central...
|
by: tracyyun |
last post by:
Hello everyone,
I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
|
by: giovanniandrean |
last post by:
The energy model is structured as follows and uses excel sheets to give input data:
1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
|
by: NeoPa |
last post by:
Introduction
For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM)
Please note that the UK and Europe revert to winter time on...
|
by: nia12 |
last post by:
Hi there,
I am very new to Access so apologies if any of this is obvious/not clear.
I am creating a data collection tool for health care employees to complete. It consists of a number of...
|
by: isladogs |
last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, Mike...
|
by: GKJR |
last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...
| |