i have a string concatenated of length 20 , all i need is to replace saying 10th position to 12th as blank irrespective of any value in those positions.
is there a way to do this?
2MAIII0123X4TGHIJKLM |
2MAIII0123X GHIJKLM |
Solved! Go to Solution.
Hi @Nandy,
The most easy way to do it is to use the formula tool and use the following formula.
Replace([Field1],
Left(Right([Field1], Length([Field1])-10),3),' ')
Where field1 is the field containing your string.
Best,
Yalmar
Nice solution, @yalmar_m.
Here's another way to approach this:
left([String],1+[Start])+" "+right([String],length([String])-[Stop]-1)
[Start]==10 and [Stop]==12. The "+1" and "-1" were added to to produce the results based on your specifications in your post.
Here's the breakdown. I'm basically building the string using pieces of the original. I'll evaluate each part step by step:
left( will return the characters on the left for the length specified
left([String],1+[Start])
left(2MAIII0123X4TGHIJKLM,1+10)
left(2MAIII0123X4TGHIJKLM,11)
=2MAIII0123X
+" "+
=adds a space
right( will return the characters on the right for the length specified
right([String],length([String])-[Stop]-1)
right(2MAIII0123X4TGHIJKLM,length(2MAIII0123X4TGHIJKLM)-12-1)
right(2MAIII0123X4TGHIJKLM,20-12-1)
right(2MAIII0123X4TGHIJKLM,7)
=GHIJKLM
So all together:
"2MAIII0123X"+" "+"GHIJKLM" yields "2MAIII0123X GHIJKLM"
@Yalmar
Yes it worked out .
thanks for your support.
Nandy