how to add space when concanating two Strings in .net?
ex.
text1.text = "Hardik"
text2.text = "Patel"
string fname = text1.text + text2.text
result ="Hardikpatel" but i want "Hardik Patel"
Loading
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.
Abhay ShankerPosted Jan 3, 2014, 5:11 AM
text1.text = "Hardik"
text2.text = "Patel"
string fname = text1.text +" "+ text2.text;
Sandeep Singh ShekhawatPosted Jan 3, 2014, 4:18 AM
using System;
class NameExample
{
public static void Main()
{
string fName = "Sandeep";
string lName = "Singh";
string fullName = string.Format("{0} {1}", fName, lName);
Console.WriteLine(fullName);
Console.ReadKey();
}
}
venkata kumarPosted Jan 3, 2014, 3:18 AM
try this
text1.text = "Hardik"
text2.text = "Patel"
string fname = text1.text +" "+ text2.text