Ho una funzione per trasformare un Nome Cognome da maiuscolo a minuscolo per lasciando la prima lettera in maiscolo
Però ha un problema: se un nome ha l'apostrofo lui me lo elimina
Vi posto il codice, sapete aiutarmi?
Potete suggerirmi anche una nuova funzione
Ciao e grazie
Public Function GetNomeProprio(ByVal nome As String) As String
Dim spazioPrima As Boolean = True
Dim sb As New System.Text.StringBuilder(nome.Length)
For Each c As Char In nome
If Char.IsLetter(c) Then
If spazioPrima Then
c = Char.ToUpper(c)
Else
c = Char.ToLower(c)
End If
sb.Append(c)
spazioPrima = False
ElseIf Char.IsWhiteSpace(c) Then
If Not spazioPrima Then
sb.Append(" "c)
End If
spazioPrima = True
End If
Next
Return sb.ToString()
End Function