I have a function in VBScript, what is it doing? how can I simplify it using C# 2.0.
Function FormatString(format, args)
Dim RegExp, result
result = format
Set RegExp = New RegExp
With RegExp
.Pattern = "\{(\d{1,2})\}"
.IgnoreCase = False
.Global = True
End With
Set matches = RegExp.Execute(result)
For Each match In matches
dim index
index = CInt(Mid(match.Value, 2, Len(match.Value) - 2))
result = Replace(result, match.Value, args(index))
Next
Set matches = nothing
Set RegExp = nothing
FormatString = result
End Function
thanks!
I converted the code to C#
please let me know of any issues