FormatVar
Like format type. Source: https://www.extensionmethod.net/csharp/string/withvar
Source
String.prototype.FormatVar = function () {
let ret = this.trim(), stf = arguments[0] || {};
for (key in stf) { ret = ret.replaceAll('{' + key + '}', String(stf[key])); }
return ret;
};
Example
var abc = {Syf: 'Sayfa', Yst: 'YoksisTip', Add:'AddUser', Addv:1 };
var sff = 'SELECT * FROM dbo.{Syf} AS S WITH (NOLOCK) WHERE (S.{Yst} IS NOT NULL) AND S.{Add} = {Addv}';
var ret = sff.FormatVar(abc);