I have a c#program,where the string is "time warner cable,charlotte,NC"
so I haave to split this string(comma separated) and I need to get only first value as time warner cable

so that I need to change in db as well as front-end code

I changed in db as LIKE companyname || '%'

but in the front end first I need to declare a variable ,and check the value exists in company name or not and make sure that null or not using if else statement.
how to write the code?

my idea is
int index = 0;
index = comp.companyname indexof (',');