Hi,
I have an input string "AAABCCDEK".I want to insert a character '^' at 4th and 8th position of the string using transformer stage.
My output should look like this "AAA^BCC^DEK".
Can somebody help me out in this logic?
Need to Insert a character in a string at particular positio
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Assuming the string is exactly nine characters long:
Code: Select all
InLink.TheString[1,3] : "^" : InLink.TheString[4,3] : "^" : InLink.TheString[7,3]
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.
So you need to len() function also:
Code: Select all
InLink.TheString[1,3] : "^" : InLink.TheString[4,3] : "^" : InLink.TheString[7,len(InLink.TheString)-6]
pandeeswaran