Using pad to trim to the right in config file

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Using pad to trim to the right in config file

abrodie
Hi all,

Apologies if I've just missed a bit of the docs, but I was looking for ways to trim a field, trim the left hand side of the string, instead of the right.  So, for example, I have the string: "1234567890" and I want to only display 5 characters, but instead of "12345" I want "67890".

I found that pad can do truncate of the right, but is there a way to do truncate the other side?

What I'm asking is the same as log4net's Pattern Layout, specifying something like %.20 to only keep the right 20 characters.

The reason I'd like this is because I'd like to trim the full class and method name in the log, I like to keep everything justified.

Cheers,

Andy