Get First and last word from sentence

        Dim Nome As String = "Carlos Galhano"
        Dim firstword As String = Nome.Substring(0, Nome.IndexOf(" "))
        Dim lastWord As String = Nome.Substring(Nome.LastIndexOf(" "c) + 1)
        Response.Write("first: " & firstword & " Last: " & lastWord)

Deixe uma resposta

O seu endereço de email não será publicado. Campos obrigatórios marcados com *