Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit ecdeafe

Browse files
committed
Add object arg overloads to Fmt to avoid params object[] allocation
1 parent a190753 commit ecdeafe

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/ServiceStack.Text/StringExtensions.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,21 @@ public static string Fmt(this string text, params object[] args)
442442
return String.Format(text, args);
443443
}
444444

445+
public static string Fmt(this string text, object arg1)
446+
{
447+
return String.Format(text, arg1);
448+
}
449+
450+
public static string Fmt(this string text, object arg1, object arg2)
451+
{
452+
return String.Format(text, arg1, arg2);
453+
}
454+
455+
public static string Fmt(this string text, object arg1, object arg2, object arg3)
456+
{
457+
return String.Format(text, arg1, arg2, arg3);
458+
}
459+
445460
public static bool StartsWithIgnoreCase(this string text, string startsWith)
446461
{
447462
return text != null

0 commit comments

Comments
 (0)