|
-
Feb 1st, 2003, 05:09 PM
#1
[*resolved] formatting a string...
I have a string and I want to make sure that the string is 6 characters long. If it's smaller, my program should put "0" for the missing characters. For example, "AA" would be "AA0000". This would be easy if this was a number, because the Format function would do it. But it doesnt work with strings. Is there a function similar to the Format function for this purpose?
Last edited by MrPolite; Feb 1st, 2003 at 06:55 PM.
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB )
VB.NET to C# conversion tips!!
-
Feb 1st, 2003, 06:50 PM
#2
PowerPoster
Can't you do something similar to this:
if mystring.Length < 6 then
for mystring.Length to 6
mystring += "0"
next
end if
-
Feb 1st, 2003, 06:55 PM
#3
Originally posted by hellswraith
Can't you do something similar to this:
if mystring.Length < 6 then
for mystring.Length to 6
mystring += "0"
next
end if
yeah I did something like that, but I was just wondering if there is a function for these kinds stuff. sounds like there isnt...
thanks
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB )
VB.NET to C# conversion tips!!
-
Feb 2nd, 2003, 12:20 AM
#4
Junior Member
How about
VB Code:
MsgBox("AA".PadRight(6, "0"))
?
-
Feb 2nd, 2003, 12:31 AM
#5
Originally posted by FireRabbit
How about
VB Code:
MsgBox("AA".PadRight(6, "0"))
?
exactly what I was looking for thanks!
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB )
VB.NET to C# conversion tips!!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|