# Name class

Namespace: [GrasshopperIO](https://developer.rhino3d.com/api/gh2/namespace/grasshopperio.md) · Assembly: [GrasshopperIO](https://developer.rhino3d.com/api/gh2/assembly/grasshopperio.md)

```cs
public class Name : IComparable<Name>, IEquatable<Name>
```

A name is used to uniquely identify a specific item or node. It is a combination of a text label and an optional integer index.

## Constructors

- [Name](https://developer.rhino3d.com/api/gh2/type/grasshopperio.name/ctor.md): (2 overloads) Constructor for names with indices.

## Fields

- [Empty](https://developer.rhino3d.com/api/gh2/type/grasshopperio.name/empty.md): (static) Gets a sensible placeholder name. Placeholders can be used if you do not care about the name, or if the node is about to be deserialised anyway.

## Properties

- [Index](https://developer.rhino3d.com/api/gh2/type/grasshopperio.name/index.md): Gets the index of this name. An index of -1 indicates no index is implied.
- [IsIndexed](https://developer.rhino3d.com/api/gh2/type/grasshopperio.name/isindexed.md): Gets whether the index has been set.
- [Label](https://developer.rhino3d.com/api/gh2/type/grasshopperio.name/label.md): Gets the label of this name.

## Methods

- [CompareTo](https://developer.rhino3d.com/api/gh2/type/grasshopperio.name/compareto.md): Compare two names.
- [Equals](https://developer.rhino3d.com/api/gh2/type/grasshopperio.name/equals.md): (2 overloads) Compare two names for equality.
- [GetHashCode](https://developer.rhino3d.com/api/gh2/type/grasshopperio.name/gethashcode.md): Gets the hash code for this name.
- [IsAllowedChar](https://developer.rhino3d.com/api/gh2/type/grasshopperio.name/isallowedchar.md): (static) Tests whether a specific char is allowed in a name label. Most latinate upper and lower case letters are allowed, as well as some symbols such as underscores, periods, colons and braces.
- [IsAllowedLabel](https://developer.rhino3d.com/api/gh2/type/grasshopperio.name/isallowedlabel.md): (static) Tests whether a string is a valid name label.
- [ToString](https://developer.rhino3d.com/api/gh2/type/grasshopperio.name/tostring.md): Gets a string representation for this name.
- [WithIndex](https://developer.rhino3d.com/api/gh2/type/grasshopperio.name/withindex.md): Change the index of this name. This is slightly quicker than creating a new Name from scratch as it skips label validation.

## Operators

- [operator ==](https://developer.rhino3d.com/api/gh2/type/grasshopperio.name/op-equality.md): (static)
- [operator !=](https://developer.rhino3d.com/api/gh2/type/grasshopperio.name/op-inequality.md): (static)

## Convertors

- [operator implicit](https://developer.rhino3d.com/api/gh2/type/grasshopperio.name/op-implicit.md): (static) Widening conversion operator from string to name. If the text ends with a hash followed by an integer constant, it is interpreted as the index.
