Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 27th, 2003, 01:41 AM
Friend of Wrox
Points: 3,558, Level: 25
Points: 3,558, Level: 25 Points: 3,558, Level: 25 Points: 3,558, Level: 25
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: California, USA
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik
Default align Center

There are 2 Methods PadLeft & PadRight for String Obj! witch make the text in Left or Right align! How can I make it Center align?!

Any help appreciated.

Always:),
Hovik Melkomian.
__________________
Always,
Hovik Melkomian.
Reply With Quote
  #2 (permalink)  
Old September 7th, 2003, 04:50 AM
Authorized User
 
Join Date: Jun 2003
Location: Glendale, California, USA.
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to HuhOiC
Default

Well this is what it does:

Right-aligns the characters in this instance, padding on the left with spaces or a specified Unicode character for a specified total length.

Overload List
Right-aligns the characters in this instance, padding with spaces on the left for a specified total length.

[C#] public string PadLeft(int);
[C#] public string PadLeft(int, char);

and the other side for padRight. So you can pad on the left. You can also pad on the right. Humm... i'm getting an idea.... So you can pad on the left and you can pad on the right, and.... humm... well I give up, I thought i had it =D. Oh I know!!! You create a method called padCenter, and do what you need in there!! Not sure how to implement it though ;). I guess Microsoft can't think of EVERYTHING for us, darn! Makes us do actually coding.

I'm just kidding, all in good fun. Sometimes the hardest thing to see, are the things right in front of us. Happens to the best of us.


RAyRAy
Huh O i C

Program or Be Programmed!!!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
EASY Q: Left-Align and Right-Align DIV? panuvin ASP.NET 1.0 and 1.1 Basics 0 December 16th, 2006 02:02 AM
align="center" in CSS crmpicco CSS Cascading Style Sheets 5 February 21st, 2006 09:31 AM
right align one part of cell and center the rest crmpicco HTML Code Clinic 0 February 21st, 2006 09:09 AM
align=right? larry Javascript How-To 11 July 6th, 2004 05:07 PM
TextBox (Align Center) Problem on Printing mrhyman VB How-To 9 February 19th, 2004 12:14 PM



All times are GMT -4. The time now is 08:48 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.