|
Imports System.Web.UI
Imports System.Text
Public NotInheritable Class LocalizedUtility
Private Sub New()
End Sub
Public Shared Function ReplaceParameters(ByVal controls As ControlCollection, ByVal text As String) As String
If controls Is Nothing OrElse controls.Count = 0 Then
Return text
End If
Dim sb As New StringBuilder(text)
For i As Integer = 0 To controls.Count - 1
If TypeOf controls(i) Is Parameter Then
Dim parameter As Parameter = CType(controls(i), Parameter)
Dim key As String = parameter.Key
Dim value As String = parameter.Value
sb.Replace("{"c + key.ToUpper() + "}"c, value)
End If
Next
Return sb.ToString()
End Function
End Class
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.