thefragileomen
thefragileomen

Reputation: 1547

Inserting a string after each character in a cell containing a string

I have a cell containing a string - B1 = "HelloWorld". What I'd like to do is, between each letter in the string, enter the string so, for example,

B2 = "H<pause>E<pause>L<pause>L<pause>O<pause>W<pause>O<pause>R<pause>L<pause>D".

I've tried '=replace(A7, "", 7, "")" but the second parameter has to be greater than 1.

Any suggestions?

Thanks

Upvotes: 1

Views: 121

Answers (1)

pnuts
pnuts

Reputation: 59495

Please try:

=REGEXREPLACE(B1,"(.)","$1<pause>")

The capture group [( )] is any character [.] output as that capture group [$1] with <pause>.

Upvotes: 3

Related Questions