LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 158
Default String centering

Suppose I have the following string:

s = "iPhone" ' string length is 6

I want to modify the above string variable such that
the string length is 20, AND, the string is centered or
padded with spaces.

The result should look like:

s = " iPhone " ' string length is 20

Does that make sense? I just want to transform a
string variable so it is padded with space characters
and it appears (somewhat) centered. I prefer
a general solution for situations where I want to
center the string within a string length of N characters.

Thanks!




 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
text centering AlanW Excel Programming 1 September 1st 07 08:22 AM
Centering Centering a Title New Users to Excel 6 December 13th 06 10:02 PM
Centering comments flyingrhino Excel Worksheet Functions 0 April 11th 06 07:25 AM
Centering columns bbc920 Excel Discussion (Misc queries) 1 July 22nd 05 04:25 AM
Centering Toolbars James L[_3_] Excel Programming 1 April 14th 04 02:37 PM


All times are GMT +1. The time now is 08:33 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"