-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature/app-check/ReplacePlaceholders
- Loading branch information
pavlo
committed
Jan 29, 2024
1 parent
28f60b9
commit ec540fd
Showing
3 changed files
with
26 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using System.Text.RegularExpressions; | ||
|
||
namespace FirebaseAdmin.Util | ||
{ | ||
internal class StringUtils | ||
{ | ||
public static string ReplacePlaceholders(string str, Dictionary<string, string> urlParams) | ||
{ | ||
string formatted = str; | ||
foreach (var key in urlParams.Keys) | ||
{ | ||
formatted = Regex.Replace(formatted, $"{{{key}}}", urlParams[key]); | ||
} | ||
|
||
return formatted; | ||
} | ||
} | ||
} |