473,396 Members | 1,707 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,396 software developers and data experts.

Padding blank space using PadRight

I tried in vain to add blank space to the end of couple variables as below:

mPadding = Convert.ToChar(" ")

mdriverBegin.PadRight(16, mPadding)

mdriverEnd.PadRight(16, mPadding)

mSitekey.PadRight(4, mPadding)

What should I use to get a blank space?

Thanks

Bill


Jun 16 '06 #1
2 8240
PadRight does not change the string, it returns a new string that has
been padded so you need a line like this:

mdriverBegin = mdriverBegin.PadRight(16, mPadding)
Bill Nguyen wrote:
I tried in vain to add blank space to the end of couple variables as below:

mPadding = Convert.ToChar(" ")

mdriverBegin.PadRight(16, mPadding)

mdriverEnd.PadRight(16, mPadding)

mSitekey.PadRight(4, mPadding)

What should I use to get a blank space?

Thanks

Bill


Jun 16 '06 #2
Thanks Chris!
This seemed to work for me.

Bill

"Chris Dunaway" <du******@gmail.com> wrote in message
news:11**********************@c74g2000cwc.googlegr oups.com...
PadRight does not change the string, it returns a new string that has
been padded so you need a line like this:

mdriverBegin = mdriverBegin.PadRight(16, mPadding)
Bill Nguyen wrote:
I tried in vain to add blank space to the end of couple variables as
below:

mPadding = Convert.ToChar(" ")

mdriverBegin.PadRight(16, mPadding)

mdriverEnd.PadRight(16, mPadding)

mSitekey.PadRight(4, mPadding)

What should I use to get a blank space?

Thanks

Bill

Jun 16 '06 #3

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

Similar topics

5
by: Thomas Mlynarczyk | last post by:
Hello, I want to style an <a> element to have a special padding on "hover", like a {padding: 3px 5px 2px 4px;} a:hover {padding: 2px 4px 3px 5px;} No problem for Mozilla. Opera 7, however,...
17
by: delerious | last post by:
I'm trying to add some simple padding to an IMG by using a padding-right style, but it doesn't work in IE. Works fine in Mozilla and Opera, though. Here's a link to a page which displays this IE...
3
by: Steve Sabljak | last post by:
I seem to having a little trouble getting a table to display correctly in both msie and firefox. I want to set the table and column widths in pixels, and have some cell padding too. The table...
26
by: Spondishy | last post by:
Hi, I have a problem with divs and padding in IE6 and Firefox. Basically my example that I have attached works exactly how I want in IE6, but padding is treated differently in Firefox. My...
2
by: JohnR | last post by:
When creating an msAccess db within the Access UI itself the fields that are text are NOT padded with blanks. For example, if I have a 10 char field and put in "HI" and then when I come back to...
5
by: Tom | last post by:
I am having a problem where an extra gap (whitespace, padding) appears in a table cell where I don't want it. The data fed in the table is via dynamic HTML, so the amount in the middle cell may...
4
by: Pascal | last post by:
hello i try to use padright and padleft to beautify the aspect of my prints. I 'd like the text to be print in two columns but i don't know the size of each string before (because they are...
9
by: zion | last post by:
Hello, In my program I get data from table with 2 fields and enter it like in example into string array. How can I add the right spaces to the string? I use the function...
4
by: Grumblegut | last post by:
Hey all, a beginner at C# here. I'm writing a console application in C# where i handle a lot of numerical data, and try to present them in a coherent, nicely aligned form. I'm using...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.