Post Reply 
Padding a string with spaces
03-04-2015, 04:09 AM (This post was last modified: 03-04-2015 04:24 AM by Mark Hardman.)
Post: #10
RE: Padding a string with spaces
(03-04-2015 03:30 AM)bobkrohn Wrote:  However, the Left Padding just ADDS these spaces in front of the String.

Maybe just subtract the length of your String from the number of desired Left pads?

Sorry about that. I've put strike-through on my previous post.

I agree that you will need to set the number of characters to pad. The problem is that the offset required doesn't seem consistent.

targetLength - stringLength - ?

I appears that this left pad "trick" is less useful than I thought.

Ceci n'est pas une signature.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Padding a string with spaces - Joe Horn - 03-02-2015, 07:20 AM
RE: Padding a string with spaces - Angus - 03-03-2015, 08:02 AM
RE: Padding a string with spaces - Han - 03-03-2015, 05:08 PM
RE: Padding a string with spaces - Mark Hardman - 03-04-2015 04:09 AM
RE: Padding a string with spaces - Angus - 03-04-2015, 05:43 AM



User(s) browsing this thread: 2 Guest(s)