Ver Mensaje Individual
  #2 (permalink)  
Antiguo 22/06/2006, 11:32
Avatar de Alex Reyes
Alex Reyes
 
Fecha de Ingreso: diciembre-2005
Ubicación: Camarillo, CA
Mensajes: 242
Antigüedad: 18 años, 4 meses
Puntos: 2
Estos es VB, no creo que tengas problema en convertirlo. Encontré el código en la web, no recuerdo el sitio.

Código PHP:
Public Function Title(ByVal [String] As StringOptional ByVal Separator As String " ") As String
        Dim ret 
As String
        
If [String].IndexOf(Separator) > -1 Then
            Dim strs 
As String() = [String].Split(Separator'split all the words so to capitalize the first letter of each'
            
For As Integer 0 To strs.Length 1
                
If strs(i).Length 1 Then
                    strs
(i) = strs(i).ToUpper
                
Else
                    
strs(i) = strs(i).Substring(01).ToUpper strs(i).Substring(1)
                
End If
            
Next
            ret 
String.Join(Separatorstrs'join them back together'
        
End If
        Return 
ret
    End 
Function 
__________________
Alex Reyes
http://jalexreyes.spaces.live.com