Link Search Menu Expand Document

strf

Explanation Replaces %n that appears in the format string with the string specified by the subsequent argument str_n.
%n specifies the next argument of the format string as %1 and the next as %2.

If there are fewer arguments than %n, it is assumed that an empty string was specified and %n is deleted.

If you want to include the character "%" in the format string, specify it in duplicate like "%%".
However, if % is not followed by a number,% is output as is.

*Added since Version 4.1.0*
*Cannot be used with Mobile version*
Call format var s = strf( formatting string [, str_1 [, str_2, ... ] ] )
Return value Replaced string
Arguments String Formatting string Formatted string
String str_n String to replace
Exception None
Example of use
var filename = "sample.txt";
MessageBox(strf("「%1」を削除します。よろしいですか?", filename), "確認", $OKCANCEL);
 
var y = 2011;
var m = 9;
var p = 120;
print(strf("%1年%2月の売上げ前年比は%3%%です\n", y, m, p));
 
var d = sysdate();
print(strf("今日は%1年%2月%3日です\n", year(d), month(d), day(d)));
 
Related item