Skip to main content
Solved

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

  • February 19, 2018
  • 2 replies
  • 300 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

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

david_r
Celebrity
  • 8394 replies
  • 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
  • 7 replies
  • 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

Thanks! It works ;]