Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 27th, 2003, 01:41 AM
Friend of Wrox
 
Join Date: Jun 2003
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.
 
Old September 7th, 2003, 04:50 AM
Authorized User
 
Join Date: Jun 2003
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!!!





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





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