Search code examples
databasefunctioncrmfilemaker

Search and Cut URL address


So lets say I have a thousand URLs in roughly the same format, but varied in length, something like below- https://stackoverflow.com/questions/asktitle?2482093480sdfsd

When all I need is "https://stackoverflow.com/questions/asktitle"

My question is, in filemaker, what would be the best way to create a calculation field, that trimmed all of the URLs down to just before the question mark, as shown above. I imagine I would somehow need to search the field for the "?" character?


Solution

  • Try:

    Left ( YourField ; Position ( YourField ; "?" ; 1 ; 1 ) - 1 )
    

    Or:

    GetValue ( Substitute ( YourField ; "?" ; ¶ ) ; 1 )