Peter Nordberg
asked on
TrimEnd
Hi,
I have this string:
SELECT * FROM image_descr WHERE keywords LIKE '% linda%' AND keywords LIKE '%2007%' AND keywords LIKE '%
I would like to trim the end so that the last part gets trimmed away:
AND keywords LIKE '%
I've tried the following:
Dim strParse As String = strSearch.TrimEnd("%", "'", "LIKE", "keywords", "AND")
Unforunately it only trims the last part like this:
SELECT * FROM image_descr WHERE keywords LIKE '% linda%' AND keywords LIKE '%2007%' AND keywords LIKE
How can I get it to trim away the rest?
Thanks for help!
Peter
I have this string:
SELECT * FROM image_descr WHERE keywords LIKE '% linda%' AND keywords LIKE '%2007%' AND keywords LIKE '%
I would like to trim the end so that the last part gets trimmed away:
AND keywords LIKE '%
I've tried the following:
Dim strParse As String = strSearch.TrimEnd("%", "'", "LIKE", "keywords", "AND")
Unforunately it only trims the last part like this:
SELECT * FROM image_descr WHERE keywords LIKE '% linda%' AND keywords LIKE '%2007%' AND keywords LIKE
How can I get it to trim away the rest?
Thanks for help!
Peter
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks! Both scripts did what I wanted!
Peter
Peter
int i = s.LastIndexOf("AND");
string x = s.Substring(0, i);
MessageBox.Show(x);