Improve company productivity with a Business Account.Sign Up
public class Program
public static void Main(string args)
//Your code goes here
String str = "John Smith";
String newstr = str.Substring(0,1) + str.Substring(str.Length-str.IndexOf(' ')-1);
Open in new window
ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.
One of a set of tools we're offering as a way to say thank you for being a part of the community.
static void Main(string args)
string Fullname = "John Smith";
string names = Fullname.Split(' ');
first = names.ToString();
last = names;
string output = first + last;
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
From novice to tech pro — start learning today.
Premium members can enroll in this course at no extra cost.