LoginSignup
1
0

More than 5 years have passed since last update.

[FileMaker]文字列置換Tips:Substitute

Last updated at Posted at 2017-01-22

置換関数substituteを入れ子で使用すると大変便利です。

Substitute(
  Substitute(
    置換元テキスト
  ;"検索テキスト2";"置換内容テキスト2")
;"検索テキスト1";"置換内容テキスト1")

例えばデータにカッコが含まれている場合

置換前

  • "iPhone6S(中古)"

置換後

  • "iPhone6S中古"

置換計算式

Substitute(
  Substitute(
   "iPhone6S(中古)"
  ;""; "") // 前カッコ削除
;  ""; "") // 後カッコ削除

--

さらにデータの半角全角が入り乱れている場合もあるでしょう。

置換前

  • "iPhone7(中古)"
  • "iPhone6(中古)"

置換後

  • "iPhone7中古"
  • "iPhone6中古"

置換計算式

Substitute(
  Substitute(
    Substitute(
      Substitute(
       - "iPhone7(中古)"
      ;""; "") // 全角前カッコ削除
    ;  ""; "") // 全角後カッコ削除
  ;"("; "") // 半角前カッコ削除
;  ")"; "") // 半角後カッコ削除
1
0
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0