2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Make(旧:integromat)で文字列を削除する方法について

Posted at

integromat内で使用している値から指定文字列を削除したい

integromatを使用していて迷った内容をメモしておきたいと思います。
様々なモジュールを使用してデータ連携を実装していると、"データ整形"が必要になってきます。

・文字列の中から日付データを抽出したい。
・前後の不要な文字列を削除したい。
など。

"Text parser"というモジュールを使用し、パターンマッチングさせる事でほとんどの場合要件を満たす事ができるのですが…正規表現は複雑なのでちょっと考えないといけない。

『単純に前についている固定の文字列を削除したいだけなのにわざわざ正規表現を使わないといけない?』
と思うことが多々あり、調べてみました。

replace関数を使用する

replaceという関数がありました。
固定の文字列を置換してくれる関数ですね。
replace( [対象の文字列] ; [置換したい文字列] ; [置換後の文字列] )
公式から.png
公式ページ通りに動きを検証してみます。結果は、

Hi World

になりました。

第3引数を空に

ということは、単純に第3引数([置換後の文字列])を空にすれば良い。
第三引数を空にした場合.png
結果は、

Hello World

置換されていない…。
空はダメなようです。

第3引数にnullを指定

第3引数([置換後の文字列])にnullを設定してみる。
第三引数をnullにした場合.png
結果は、

Hello World

これもダメでした。

結論

試行錯誤していると「emptystring」(空文字列)というのを見つけました。
「emptystring」を指定する事で、無事に対象文字列を削除(空文字列に置換)する事ができました。
第三引数をemptystringにした場合.png

2
3
0

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
2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?