Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Padding right using string format
Message
De
12/12/2007 00:19:25
 
 
À
10/12/2007 11:01:41
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Divers
Thread ID:
01274270
Message ID:
01275037
Vues:
23
I guess it depends on what result he actually wants. The question was a little ambiguous to begin with.

~~Bonnie



>>Hi,
>>I have string format expression as below:
>>
>>
string.Format("Total {0} Amount:", lcDescription);
>>
>>How could make the string expression above (after evaluated) to have fixed length?
>>
>>Thank you
>
>Assuming your fixed lenght is 20 and right aligned (use -20 for left aligned):
>
string.Format("Total {0,20} Amount:", lcDescription);
>Cetin
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform