Hello. I'm new to C#. I've searched this group, and tried other google
searches, and have not found an answer to this question already.
The question is pretty simple. I like the Console.WriteLine format of
passing a string containing {0}, {1}, etc, followed by a parameter
list of values. For example:
Console.WriteLine("The value is {0}", someValue);
I would like to be able to create strings in my applications using the
same format, with the {x} replacement. Is there a class I can call to
do this? I don't yet know my way around C# enough to figure this out. 2 2997
You can use format method of String class.
SG
<da*********@gmail.comwrote in message
news:11*********************@u2g2000hsc.googlegrou ps.com...
Hello. I'm new to C#. I've searched this group, and tried other google
searches, and have not found an answer to this question already.
The question is pretty simple. I like the Console.WriteLine format of
passing a string containing {0}, {1}, etc, followed by a parameter
list of values. For example:
Console.WriteLine("The value is {0}", someValue);
I would like to be able to create strings in my applications using the
same format, with the {x} replacement. Is there a class I can call to
do this? I don't yet know my way around C# enough to figure this out.
String.Format
Użytkownik "Gugale at Lincoln" <gu**************@gmail.comnapisał w
wiadomo¶ci news:Zl*****************@newssvr25.news.prodigy.ne t...
You can use format method of String class.
SG
<da*********@gmail.comwrote in message
news:11*********************@u2g2000hsc.googlegrou ps.com...
>Hello. I'm new to C#. I've searched this group, and tried other google searches, and have not found an answer to this question already.
The question is pretty simple. I like the Console.WriteLine format of passing a string containing {0}, {1}, etc, followed by a parameter list of values. For example:
Console.WriteLine("The value is {0}", someValue);
I would like to be able to create strings in my applications using the same format, with the {x} replacement. Is there a class I can call to do this? I don't yet know my way around C# enough to figure this out. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Rigga |
last post by:
Hi all,
I am wondering why string's are not true objects?.... Let me explain...
If i write the code
Dim x1 as String = "veg"
Dim x2 as String = "veg"
If x1 = x2 then
|
by: Colin Savage |
last post by:
Please could somebody explain what an "atomized string" is? I have been
doing loops in the msdn around XmlNameTable and NameTable but neither
explain what an atomized string is. The example for one...
|
by: Robert Blackwell |
last post by:
I decided to take a class at the local college here and I'm a little
confused about something.
int age = 5;
Console.WriteLine("You are " + age + " years old");
Previously, I had been...
|
by: Clinton Pierce |
last post by:
I'm calling a method in another assembly that's supposed to return a
string, and possibly that string might be empty. The code looks
something like this:
string d = r.Field("date").ToString();...
|
by: Ashok |
last post by:
Hello
I need to programmatically change the permissions (ACL) on a specific
registry key in a .NET app. Is there a way to do this in .NET?
Thanks for the help,
Ashok
|
by: josh |
last post by:
Hi,
I am trying to validate cXML documents against cXML.dtd using the
XmlValidatingReader. If I set the XMLValidatingReader's ValidatingType
to ValidationType.DTD, I get the following...
|
by: DLN |
last post by:
Hello all,
I have a quick question regarding how best to use static strings in my C#
code that I'm hoping someone can help me with. Is there any
advantage/disadvantage from a performance...
|
by: Andrus |
last post by:
I created dynamic extension methods for <= and < SQL comparison operators:
public static IQueryable<TLessThanOrEqual<T>(this IQueryable<Tsource,
string property, object value);
public static...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
| |