Im using asp.net using c#.net to retrieve a field from database. The field is xyz. It contains the data value say qwerty~rtyuup. I want to split the data right and left to ~ say(qwerty) and (rtyuup) using a string. For this i have used the code as follows:
String abc();
abc = con.dr["xyz"].Tostring().split["~"];
This is not working. Please help me thanx in advance.
happyns
0
Newbie Poster
Recommended Answers
Jump to PostHi,
Split function returns "string array" not a string value.
Modify the code as follows;
string[] abc = con.dr["xyz"].Tostring().split('~');
Good luck.
All 2 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.