Suppose i write in a text box Ankit Kumar Shukla
when i click on button it must be return A K S ?
how do i that ?
thank u
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Upendra Pratap ShahiPosted Aug 12, 2015, 7:08 AM
Use below code,
string[] splitword = s.Split(' ');
string sStartName = "";
foreach (string eachword in splitword)
{
}
Console.WriteLine(sStartName);
Console.ReadKey();
Upendra Pratap ShahiPosted Aug 17, 2015, 5:03 AM
Hemlata KushwahaPosted Aug 12, 2015, 8:09 AM
Ankit ShuklaPosted Aug 12, 2015, 6:54 AM
Hemlata KushwahaPosted Aug 12, 2015, 5:16 AM
Upendra Pratap ShahiPosted Aug 12, 2015, 5:14 AM
string s = "Upendra Pratap Shahi";
string[] splitword = s.Split(' ');
string sStartName = "";
foreach (string eachword in splitword)
{
}
lblMessage.Text = sStartName;
Munesh SharmaPosted Aug 12, 2015, 5:14 AM
Upendra Pratap ShahiPosted Aug 12, 2015, 5:10 AM
string strtest1 = "Upendra";
string strtest2 = "Pratap";
string strtest3 = "Shahi";
string strtest = strtest1.Substring(0,1) + " " + strtest2.Substring(0,1) + " " + strtest3.Substring(0,1);
Output- U P Sstring strtest1 = TextBox1.Text.ToString().Trim();
string strtest2 = TextBox1.Text.ToString().Trim();
string strtest3 = TextBox1.Text.ToString().Trim();
string strtest = strtest1.Substring(0,1) + " " + strtest2.Substring(0,1) + " " + strtest3.Substring(0,1);
lblMessage.Text= strtest.ToString();
Syed ShanuPosted Aug 12, 2015, 5:05 AM