Re: String.PadLeft Method
- From: "Greg Young" <DruckDruckGoose@xxxxxxxxxxx>
- Date: Tue, 9 May 2006 10:57:50 -0400
How is this behavior not consistant with the documentation?
"Right-aligns the characters in this instance, padding on the left with
spaces or a specified Unicode character for a specified total length. "
If the size was < the length there would be no padding to perform.
Cheers,
Greg Young
"Reny" <reny@xxxxxxxxxx> wrote in message
news:%23Xpmwa2cGHA.1456@xxxxxxxxxxxxxxxxxxxxxxx
Hi,
I came across a doubt on the String.PadLeft Method.The doubt is this --
What's difference it make if the argument to this function carries an
integer whose value is less than the length of the string object
For example in the sample code below(VB.NET) I could not see any
difference
Dim str As String
str = "BBQ and Slaw"
Console.WriteLine(str.PadLeft(5)) ' Displays "BBQ and Slaw".
Console.WriteLine(str.PadLeft(15)) ' Displays " BBQ and Slaw".
I could not notice any difference with the output of str.PadLeft(5) and
the original str string.Both carries the same message "BBQ and Slaw"
Can any one tell me what is the use of this particular function if the
padleft paramater is less than the length of the string.
Reny
.
- References:
- String.PadLeft Method
- From: Reny
- String.PadLeft Method
- Prev by Date: Caching and cookieless sessions
- Next by Date: Re: Problem Could not find schema Warning Messages in VS 2005 app.conf
- Previous by thread: Re: String.PadLeft Method
- Next by thread: Deploying application to terminal servers
- Index(es):
Relevant Pages
|