以下の内容はhttps://shuzo-kino.hateblo.jp/entry/2018/07/26/232414より取得しました。


Google Apps Scriptの文字列フォーマット系関数

Google Apps Scriptにも文字列フォーマットの関数が用意されています。

実際の所

文字列を成型する場合はfomatString関数です。
構文はおなじみのsprintf。
Utilitiesの関数のため、書き方文字列自体は長くなってしまいますが……。

  //同じ意味
  var filename = nowDate + "." + doctype

  var filename = Utilities.formatString("%s.%s",nowDate,doctype);
  //同じ意味
  var fetchUrl = "https://docs.google.com/a/" + YOURDOMAIN + "/document/export?format=docx&id=" + docid;

  var fetchUrl = Utilities.formatString("https://docs.google.com/a/%s/document/export?format=docx&id=%s", YOURDOMAIN, docid); 


時刻用のformatDate関数というのもあります。
記法はJavasimpleDateFormatにならっています。

  var nowDate = Utilities.formatDate(new Date(), 'JST', 'yyyyMMdd');



以上の内容はhttps://shuzo-kino.hateblo.jp/entry/2018/07/26/232414より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14