RemoveSmartQuotes ( )

Function stats

Average user rating
230
247
9999
Support
FileMaker 10.0 +
Date posted
09 February 2010
Version
1
Recursive function
No

Author Info
 Andrew Duncan

1 functions

Average Rating None

author_avatar



 

Function overview

Prototype

RemoveSmartQuotes  ( text )


Parameters

text  


Description

Tags:  smart quote substitute apostrophe  

FileMaker Pro has the option per file to use smart quotes which are represented as the curly quotation marks and curly apostrophes which is set via the File menu > File Options>Text tab. These smart quotes can cause problems when interfacing with external systems that don't support smart quotes.

This functions uses the new Char function in FileMaker Pro v10 to remove any single or double smart/curly quotes from the specified text and replace them with plain (straight) quotes and apostrophes. (You can make this function work with previous version of FileMaker by copy/pasting an example of each left/right single and double smart quote/apostrophe into the calculation in place of the Char function).

Examples

Sample input

“hello World”


Sample output

"hello World"

 

Function code

// SYNTAX: RemoveSmartQuotes (text)
// ORIGIN: http://www.databuzz.com.au
// NOTES: Removes Smart/Curly Quotes and Apostrophes from specified text into non smart/curly quotes and apostrophes. Requires FileMaker 10 or higher
// VERSION: 1.0v1
// © 2010 Andrew Duncan, Databuzz,Sydney, Australia


Substitute (

text ;

[ Char ( 8216 ) ; "'" ] ; // left smart quote
[ Char ( 8217 ) ; "'" ] ; // right smart quote

[ Char ( 8220) ; "\"" ] ; // left double smart quote
[ Char ( 8221) ; "\"" ] // right double smart quote

)

// ===================================
/*

    This function is published on FileMaker Custom Functions
    to check for updates and provide feedback and bug reports
    please visit http://www.fmfunctions.com/fid/247

    Prototype: RemoveSmartQuotes( text )
    Function Author: Andrew Duncan (http://www.fmfunctions.com/mid/230)
    Last updated: 09 February 2010
    Version: 1

*/
// ===================================

 

 

 

 


Login or register to comment

Create a new account with fmcustomfunctions.com or login to post a comment.

 

 

 

Top Tags

Text Parsing  (24)
List  (19)
XML  (15)
Format  (14)
Date  (12)
Debug  (12)
Layout  (11)
Variables  (10)
Filter  (9)
Layout Objects  (6)
ValueIterator  (6)
Recursive  (5)
Dev  (5)
Interface  (5)
Text  (5)
Number  (5)