Click here to Skip to main content
15,891,253 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
pubilc void test()
{

string str = "name=welcome to codeproject;ok=yes";

}
UI layer:]

Name: textbox(to assign the str splitted value of 'name')


result will be displayed like
Name: welcome to codeproject

What I have tried:

string str = "name=welcome to codeproject;ok=yes";

string str1="name=welcome to codeproject";
string str2= "ok=yes";
string str = str1 + str2;
Posted
Updated 16-Mar-16 21:16pm
v3
Comments
VR Karthikeyan 17-Mar-16 2:47am    
Question is not clear. What's your input? and expected output? Improve your question. Help us to help you.
Member 12398028 17-Mar-16 3:00am    
the output was
Name: welcome to codeproject.
VR Karthikeyan 17-Mar-16 5:56am    
See the solution.
Patrice T 17-Mar-16 3:04am    
Asking question is a skill.
Asking questions is a skill[^]

1 solution

Use like following,
C#
string str = "name=welcome to codeproject;ok=yes";
string[] splitted = str.Split(';');
YourTextBox.Text = splitted[0]; 

Read about strings in c# for more information. Use below links,
1. String Methods (System)[^]
2. C# - Strings[^]
 
Share this answer
 

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