tincho   15-04-2021, 11:11
#1
Esta hace lo mismo que la función de Go que se llama igual.
Código:
'' <b>RAD Extension.</b><br>
'' Converts the first character of each word to upper case.
'' GO Package strings

Static Public Function Title(s As String) As String

  Dim sTmp As String
  Dim word As String
  Dim aOut As New String[]

  sTmp = Trim(RTrim(s))
  While InStr(sTmp, "  ")
    sTmp = Replace(sTmp, "  ", " ")
  Wend

  For Each word In Split(sTmp, " ")
    aOut.Add(Upper(Mid(word, 1, 1)) & Mid(Lower(word), 2))
  Next

  Return aOut.Join(" ")

End
Saludos.
Última modificación: 05-06-2022, 20:17 por tincho.

1 Saludo.
  
Usuarios navegando en este tema: 3 invitado(s)
Powered By MyBB, © 2002-2024 MyBB Group.
Made with by Curves UI.