Your technology certification is waiting. Enroll in Cloud Class ®
Dim result As String = source.Substring(0, source.IndexOf("("c)).Trim()
Open in new window
Dim result As String = source.Split("(")(0).Trim
This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.
which prevents an error if there is no "(" in the source string:
Dim result As String = source.Substring(0, If(source.IndexOf("("c) < 0, source.Length, source.IndexOf("("c))).Trim()
Dim result As String = System.Text.RegularExpressions.Regex.Replace(s, "\s*\(.*\)", "")
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.