how to get fullname in csharp

To get the full name in C#, you can use string manipulation techniques such as concatenation or a specific method to extract the first and last name and join them together. Here's an example using concatenation:

main.cs
string firstName = "John";
string lastName = "Doe";
string fullName = firstName + " " + lastName;
98 chars
4 lines

Alternatively, you can also use the String.Format() method to format the string:

main.cs
string fullName = String.Format("{0} {1}", firstName, lastName);
65 chars
2 lines

In both cases, the output would be "John Doe" as the full name.

gistlibby LogSnag