Link to home
Start Free TrialLog in
Avatar of newbie27
newbie27Flag for United Kingdom of Great Britain and Northern Ireland

asked on

VB.NET STRING FUCNTION

Hello Experts

 I am getting a data from the database column in the following format, I am trying to retrieve the last word after ":"

Sometimes I may get 3 strings concatenated with colon or sometimes 4, regardless of this I want to get the last name

POSelID: p502<br>Ice Creams:Neapolitan
POSelID: p564:o26:6m<br>Film Quote Babygrow - The Force is Strong in This One:6m
POSelID: p502<br>Ice Creams:TestOption

Please can someone let me know how can I get the exact value after retrieving it from  the DB column,

AttributeName = UCase(row.Item("options"))  
ex: AttributeName = Neapolitan

Thanks
ASKER CERTIFIED SOLUTION
Avatar of Zhaolai
Zhaolai
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of PhilosW
PhilosW

Try This:
         Dim _lstTemp As List(Of String) = "POSelID: p502<br>Ice Creams:Neapolitan".Split(":").ToList()
         Dim _lastName As String = _lstTemp(_lstTemp.Count - 1)