473,769 Members | 8,267 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Pa dRight(16, mPadding)

mdriverEnd.PadR ight(16, mPadding)

mSitekey.PadRig ht(4, mPadding)

What should I use to get a blank space?

Thanks

Bill


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

mdriverBegin = mdriverBegin.Pa dRight(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.Pa dRight(16, mPadding)

mdriverEnd.PadR ight(16, mPadding)

mSitekey.PadRig ht(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.goo glegroups.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.Pa dRight(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.Pa dRight(16, mPadding)

mdriverEnd.PadR ight(16, mPadding)

mSitekey.PadRig ht(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
14709
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, behaves strangely and does not apply the background color to the padded area. And IE5 seems to ignore the hover-padding.
17
29240
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 problem: http://home.comcast.net/~delerious1/index12.html I do know that I can solve the problem in IE by changing padding-right to margin-right, but then the links cannot be clicked when the mouse is over that margin area. So I would...
3
10715
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 displays correctly in standards compiance mode in firefox, but not msie, where the padding is added on to the column widths. the table size is always correct, but the column widths are not what I expect them to be. If I change the column widths to...
26
8409
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 example is below. http://www.villas2u.com/example/test.htm http://www.villas2u.com/example/styles.css I realise that the issue is with the padding of 10px pushing the
2
3164
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 the field and click my mouse on it the cursor is just after the "I" in "HI"... that is, no blanks were added to the field. However, when I create an MDB database programatically in VB.Net using ADOX and create the tables using SQL stmts (ie:...
5
10531
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 vary. When the data in the middle table cell is little and that cell's height is small, an unwanted gap appears in the first table cell. I would prefer to have all additional blank space at the bottom of the table (last row) and not have any in...
4
4432
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 randomly generated) I thought that padright complete the lenght of a string to the size noticed as a variable like padright (50) if the string is 35 of lenght so padright add 15 to fit to the given size of 50. But it seems it doesn't work like this ?...
9
7086
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 mystring.Tostring().PadLeft(10,' ') but the result is not good. 1234567890 | ABCDEFG
4
3939
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 System.Console.WriteLine I have 8 - 10 columns of data for each record, each item per record contains 1 to 10 digits. The problem i have is that i can't figure out how to align things. '\t' obviously wouldn't work well, because if you're on a tab...
0
9589
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10216
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10049
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9997
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9865
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5310
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3965
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3565
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.