Skip to main content
Solved

How to insert a character inbetween the string with different lentgh?

  • February 19, 2018
  • 2 replies
  • 224 views

Forum|alt.badge.img

Hello.I need to insert a dash into a phone number after first

 

digit. I know how to do it using attribute manager and text editor only

 

if the length of the number is always the same. In this case is not. Is there a code I can put instead of "X" to indicate the rest of the value? If I will put fixed number the outcome is incorrect because of mentioned before different string length.

Maybe there is other way?

Thanks,

Cheers

Best answer by david_r

You can use the following expression:

@Left(@Value(phone_no),1)-@Substring(@Value(phone_no),2)

You can also use the StringReplacer:

0684Q00000ArKD6QAN.png

View original
Did this help you find an answer to your question?

2 replies

david_r
Celebrity
  • Best Answer
  • February 19, 2018

You can use the following expression:

@Left(@Value(phone_no),1)-@Substring(@Value(phone_no),2)

You can also use the StringReplacer:

0684Q00000ArKD6QAN.png


Forum|alt.badge.img
  • Author
  • February 19, 2018
david_r wrote:

You can use the following expression:

@Left(@Value(phone_no),1)-@Substring(@Value(phone_no),2)

You can also use the StringReplacer:

0684Q00000ArKD6QAN.png

Thanks! It works ;]

 

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings