Brian Dunning's FileMaker Custom Functions

InsertCharacter ( text ; index ; char )

Inserts a specified character in between each character of a specified string.

  Average rating: 4.3 (32 votes) Log in to vote

George Norsworthy   George Norsworthy
Bell Mountain Assoc.
http://bellmountainassoc.com

Share on Facebook Share on Twitter

  Sample input:
InsertCharacter ( "Filemaker" ; 9 ; "_" )
  Sample output:
F_i_l_e_m_a_k_e_r

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

Inserts a specified character in between each character of a specified string. The variable "index" needs to be the length of the "text" string.

 

Comments

Gary   Gary, Bonn/Germany
Sep 13, 2013
Am I missing something here? When I use this function (which is very cool, btw), it also inserts a trailing char…

The above mentioned sample output is on my machine: F_i_l_e_m_a_k_e_r_

It doesn't matter in my database, but it would be nicer if the trailing char would not be there.

Anyone any ideas?
 
unix   unix, Japan
Sep 28, 2013
Case ( Index < 2 ; Text ;
InsertCharacter ( Replace ( Text ; Index ; 0 ; chr ) ; Index - 1 ; chr )
)
 

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 15 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth:

Under construction. Email me your wish list for improvements.