Click to See Complete Forum and Search --> : ASP Trim Function Question


theflyingminst
08-29-2008, 01:10 PM
Hi there, I am outputting a search and replace type form in ASP and I have lines that are coming out uneven:

Ex:

-----------------------
------------------------------
-----------------------
--------------------------

Is there a function I can use that makes all of the lines the same length based on the shortest (or longest) length outputted? Also is there a way for this function to trim only lines that have certain characters (ex: "-")? I'm not sure if this would fall into the Trim category (but I titled the post as such).

Thank you.

sstalder
08-30-2008, 08:08 PM
The answer to both your questions is yes, although the Trim function would have nothing to do with it.

You will have to write your own custom function for both methods.

theflyingminst
08-30-2008, 08:09 PM
Good deal. Thanks

Bullschmidt
09-07-2008, 05:17 PM
Not sure exactly what you're trying to do but to pad with leading -'s up to 20 digits:
varFld = Right("-" & varFld, 20)

Thus this:
Hey
Ho
Whatever

Would look like this:
-----------------Hey
------------------Ho
-----------Whatever

And if needed you could change the font to something where each character has the same width such as Courier New.

theflyingminst
09-08-2008, 12:04 AM
Great idea, thanks so much Paul!