3
Contributors
4
Replies
24
Views
4 Years
Discussion Span
Last Post by Deegirl
0
Dim name As String = "Don Paul"
Dim position As Integer = name.IndexOf("P") ' get the position of the first letter in the surname    
Dim reversed As String = name.Substring(position) + ", " + name.Substring(0, 1) 'join the surname with the first letter of the name

Hope this helps

0

Mind you if you have different names you want to process it might be better to use the space instead:

    Dim name As String = "Don Paul"
    Dim position As Integer = name.IndexOf(" ") + 1
    name = name.Substring(position) & ", " & name.First

Edited by tinstaafl

0

i agree tinstaafl; I substituted as I went along. thank a lot wrathness.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.