public static void p (string c) {
public static void Main()
string CandidateFirstName = "TestFirstName";
string CandidateLastName = "TestLastName";
string FromDisplayName = "firstname lastname";
var fromDisplayNameSeparatorIndex = string.IsNullOrWhiteSpace(FromDisplayName) ? null : (int?)FromDisplayName.IndexOf(' ');
p(fromDisplayNameSeparatorIndex.ToString());
var CreateUserFirstName = fromDisplayNameSeparatorIndex.HasValue ?
fromDisplayNameSeparatorIndex.Value < 0 ? FromDisplayName : FromDisplayName.Substring(0, fromDisplayNameSeparatorIndex.Value)
p(FromDisplayName.Substring(0, fromDisplayNameSeparatorIndex.Value));
var CreateUserLastName = fromDisplayNameSeparatorIndex.HasValue ?
fromDisplayNameSeparatorIndex.Value < 0 ? string.Empty : FromDisplayName.Substring(fromDisplayNameSeparatorIndex.Value)
p(FromDisplayName.Substring(fromDisplayNameSeparatorIndex.Value));
var CandidateFirstName = "TestFirstName";
var CandidateLastName = "TestLastName";
string fromDisplayName = "firstname lastname";
string[] splittedFullName = fromDisplayName?.Split(" ", StringSplitOptions.RemoveEmptyEntries);
p(splittedFullName.Length.ToString());
var firstname = splittedFullName?[0] ?? CandidateFirstName;
var lastname = splittedFullName?[1] ?? CandidateLastName;