Contact.Name Contact.Name Contact.Name Contact.Name Contact.Name Property

Definition

Note

Name may be altered or unavailable for releases after Windows 8.1. Instead, use FirstName.

Sets and gets the name of the contact.

public : Platform::String Name { get; set; }
winrt::hstring Name();

void Name(winrt::hstring name);
public string Name { get; set; }
Public ReadWrite Property Name As string
var string = contact.name;
contact.name = string;
Property Value
string string string

The name of the contact.

Additional features and requirements
Capabilities
contactsSystem

Examples

This example shows a function taking the name property and returning the first and last names of the contact.

function getFirstAndLastName(contact) {
    var name = contact.name;
    if (name.indexOf(" ") != -1) {
        var firstAndLast = name.split(" ");
        return {
            first: firstAndLast[0],
            last: firstAndLast[1]
        };
    } else {
        return null;
    }
}

Remarks

An app can set the name property to any value that matches the name of a contact. We recommend that you set this value to contain both the first and last names of the contact, if that information is available.