GetChar ( )

Function stats

Average user rating
FileMaker 7.0 +
Date posted
05 December 2008
Recursive function

Author Info

7 functions

Average Rating 2.7



Function overview


GetChar  ( text;   number )





Tags:  Text Parsing  

Returns the specified character (by number) from a string.
When using the Middle function to parse one character only, the character count is redundant.


Sample input

GetChar ( "David"; 3 )

Sample output



Function code

GetChar ( text; number )
Purpose: Returns the specified character (by number) from a string.
Author: David Head, uLearnIT

Middle ( text ; number ; 1 )

// ===================================

    This function is published on FileMaker Custom Functions
    to check for updates and provide feedback and bug reports
    please visit

    Prototype: GetChar( text; number )
    Function Author: uLearnIT (
    Last updated: 05 December 2008
    Version: 1

// ===================================



19 December 2008

What is thte advantage in using this CF rather than simply using the Middle function?
  General comment
19 December 2008

Thank you for asking the question. Although not at all difficult, this function fits neatly with the existing GetValue function provided in FileMaker Pro. When using Middle, I find that much of the time I am looking for one character only so the numberofChar argument is always 1. This function simplifies the expression you use when extracting a single word. I feel that this is a very strong feature of custom functions - simplifying expression and meaning.
  General comment
01 December 2010

While not particularly ingenious, I don't think the function needs to be rated down to two stars. To be honest it should probably be included in the FM core library along with GetValue - just because you can do something another way, doesn't mean there shouldn't be a simpler more direct way to get what you're after. When coding in PHP, Ruby or .Net for example you have a whole arsenal of string parsing functions that allow you to produce the cleanest code possible in the most efficient way possible - don't know why you wouldn't have the same for FM.

GetWord( string ; position ) or GetChar( string ; position ) is significantly easier to interpret when reviewing code (just from a human readability standpoint) than MiddleWords( string ; startposition ; 1 ) or Middle( string ; startposition ; 1 ).

Arguably, having it posted on this site provides a consistent reference point for one form of the function which could be referred back to between projects.

Just my 2c.
  General comment






Top Tags

Text Parsing  (33)
List  (32)
Date  (30)
XML  (27)
Format  (23)
Sql  (22)
Dev  (20)
Debug  (17)
Layout  (15)
Interface  (15)
Text  (14)
Variables  (13)
Filter  (12)
Design  (11)
Layout Objects  (11)
Array  (8)