Left Pad a string with specified character
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 284
- Joined: Fri Oct 13, 2006 4:31 am
Left Pad a string with specified character
How do I left pad an input string with a specific character and get the desired output? For example, if the input is ABC I want to pad X to the left of ABC and get the output as XABC
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
For that specific case, with "X" as the pad character and 4 as the width of the output:
Generalize to other requirements.
Code: Select all
Right(Str("X",4):InLink.TheField, 4)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.