Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Convert Letter to uppercase
Message
From
21/05/2003 16:57:37
 
 
To
21/05/2003 16:33:04
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00791332
Message ID:
00791357
Views:
21
Hi, Mufi.

>I want to conver all first letter in captial after the white space.

It seems that there's no native method to do that in .NET... anyway, you can either use the VFP Toolkit for .NET (http://www.gotdotnet.com/team/vfp/), or use its source-code wrapping it up in your own classes. See:
Public Shared Function Proper(ByVal cString As String) As String

'Create the StringBuilder
Dim sb As StringBuilder = New StringBuilder(cString)

Dim i As Integer, j As Integer = 0
Dim nLength As Integer = cString.Length

For i = 0 To nLength - 1 Step i + 1
      If (i = 0) Or (Char.IsWhiteSpace(cString.Chars(i))) Then
             If i = 0 Then
                 j = i
             Else
                 j = i + 1
             End If

             sb.Remove(j, 1)
             sb.Insert(j, Char.ToUpper(cString.Chars(j)))
      End If
Next
Return sb.ToString()
End Function
HTH
Claudio Lassala
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform