Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Convert Letter to uppercase
Message
De
21/05/2003 16:57:37
 
 
À
21/05/2003 16:33:04
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00791332
Message ID:
00791357
Vues:
20
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform