Insert one character into a text string

I’m trying to handle a case where the (Account Number) text string is 9 characters long, and I want to insert a single character (single dash) between the second and third characters. In other languages I would break into 2 substrings and concatenate 3 strings (with, say, ‘&’ as the concat operator.) And could do it in a single statement.

As a relative newbie to Make, all I see suggests I have to create the 2 substrings using text function, ADD() both to an empty array, then apply JOIN() that array using the “-” as the separator. Is that really the simplest way? Seems like a relative mouthful. thx.
Stew

Hello @StewC,

I do believe the easiest way is to use two substring functions to split the string into two parts then contact them.
Something like this:

substring(account number;0;2)&substring(account number;2;9)

2 Likes

Hi @Donald_Mitchell ,

Thanks! Yes, I thought there must be a simple way. I substituted the “ampersand” in your example for the dash that I wanted. Ah, there’s no operator required between substrings…got it.

2 Likes