Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Padding right using string format
Message
From
12/12/2007 00:19:25
 
 
To
10/12/2007 11:01:41
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01274270
Message ID:
01275037
Views:
25
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform