473,387 Members | 1,721 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Left Pad

How would one left pad a string with a repeating character?
For example, to create a 9 character string left padded with zeroes:

999 should become 000000999
1 should become 000000001

and so on...

Thanks for any help!
Dec 6 '05 #1
4 13041
"Mark" <Ma**@discussions.microsoft.com> schrieb:
How would one left pad a string with a repeating character?
For example, to create a 9 character string left padded with zeroes:

999 should become 000000999
1 should become 000000001


\\\
MsgBox("999".PadLeft(10, "0"))
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Dec 6 '05 #2
Thank you very much.

Mark

"Herfried K. Wagner [MVP]" wrote:
"Mark" <Ma**@discussions.microsoft.com> schrieb:
How would one left pad a string with a repeating character?
For example, to create a 9 character string left padded with zeroes:

999 should become 000000999
1 should become 000000001


\\\
MsgBox("999".PadLeft(10, "0"))
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Dec 6 '05 #3
dgk
On Tue, 6 Dec 2005 23:17:19 +0100, "Herfried K. Wagner [MVP]"
<hi***************@gmx.at> wrote:
"Mark" <Ma**@discussions.microsoft.com> schrieb:
How would one left pad a string with a repeating character?
For example, to create a 9 character string left padded with zeroes:

999 should become 000000999
1 should become 000000001


\\\
MsgBox("999".PadLeft(10, "0"))
///


PadLeft? String has a PadLeft? They thought of almost everything.
Look, there's a PadRight too! There goes Lset and Rset, if they aren't
gone already.
Dec 7 '05 #4
"dgk" <dg*@somewhere.com> schrieb:
How would one left pad a string with a repeating character?
For example, to create a 9 character string left padded with zeroes:

999 should become 000000999
1 should become 000000001
\\\
MsgBox("999".PadLeft(10, "0"))
///


PadLeft? String has a PadLeft?


Yes :-)!
There goes Lset and Rset, if they aren't gone already.


These methods are still supported. However, they can only be used to use
space characters as padding character.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Dec 7 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Wayne Wengert | last post by:
I use statements like LEFT(textstring,6) in my app. I have "Imports Microsoft.VisualBasic" at the top of the code but to use LEFT I have to code : Microsoft.VisualBasic.Left(sting, integer) If...
4
by: Harlan Messinger | last post by:
What is *supposed* to be the way to specify the horizontal offset of (a) the list item's marker and (b) the list item's content? In particular, see ...
4
by: jbm05 | last post by:
Hi, I'm curious about the computational complexity of a query I have. The query contains multiple nested self left joins, starting with a simple select, then doing a self left join with the...
1
by: fleemo17 | last post by:
For increased accessibility, I've replaced "display:none" with the Off-Left method of hiding my CSS drop-down menus because the Jaws screen reader doesn't see any of the menus hidden with...
17
by: Nathan Given | last post by:
Hello All, I am trying to debug a broken query. The query uses Left$(,4) instead of Left(,4). What is the difference between the Left() and Left$() functions in Microsoft Access? Thanks!...
0
by: jonipony | last post by:
HELP: Float Left box is drifting to the right in ie! -------------------------- I need som HELP with my CSS coding! On the following web page my design falls apart at screen size 800 x 600...
8
by: marco | last post by:
Hi ! I have this part of code and i can not find out why the scroller is starting from left to right instead RIGHT to LEFT. This is the main part and the scroller is working fine but from the...
6
by: Samuel Rhodes | last post by:
Hi I am trying to write a code snippet that would display a '?' sign on the top left of a control. I do not want to hard code the positioning of the DIV which will contain that '?'. Is it...
6
by: =?Utf-8?B?R3JlZw==?= | last post by:
I have two questions with regards to the LEFT function. I ran into a problem with the LEFT function today. I knew it was a valid Function, but when I tried to use it, it was getting interpreted...
8
by: muiz123 | last post by:
I study http://www.javascripttoolbox.com/lib/objectposition/index.php source and its doesn't work fine for the following code: (I hope both IE and firefox are working well) <!DOCTYPE HTML...
0
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,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
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...
0
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
0
BarryA
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...
0
marktang
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,...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.