Click here to Skip to main content
16,022,971 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have string as given below , this is part of where clause of sql statement.

string str = "product.product_id = employee.text_1 and product.code_1 = employee.text_2";

I want to split this by 'and' using C#.

Could you please help me
Posted
Updated 29-Mar-12 0:46am
v2

1 solution

You can use following code to split string.

C#
string[] splitted = Regex.Split(value, "and");


And you need to include following using directive to use Regex.

C#
using System.Text.RegularExpressions;



Hope this help!
 
Share this answer
 
Comments
P.Antoni 29-Mar-12 7:25am    
Thanks for the help.It works fine.
ProEnggSoft 29-Mar-12 12:59pm    
To the point. +5

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900