Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Padding right using string format
Message
De
10/12/2007 11:01:41
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
09/12/2007 07:22:35
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:
01274441
Vues:
20
>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
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform