Struct Title
Represents an individual's title (e.g., Mr., Mrs).
public readonly struct Title
- Inherited Members
Remarks
Some ideas on standardisation sourced from
https://assets.publishing.service.gov.uk/government/uploads/system/uploads/attachment_data/file/1112942/Titles__V12_.pdf.
As per general Government guidance, no attempt is made to deduce a person's gender from their title.
Methods
Parse(string?)
Inspects the supplied title and returns a new Title instance holding either the title supplied, or if it is a standard title (e.g., Mr, Mrs, Miss, etc.) then the standardised form of that title.
public static Title? Parse(string? title)
Parameters
title
stringExternally supplied string value for title.
Returns
- Title?
Null if no title provided, a standardised title (e.g., "Mr") if a standardised title is provided, or the supplied string otherwise.
ToString()
Gets the string representation of the Title.
public override string ToString()
Returns
- string
String representation of title, e.g., "Mr", "Ms".
Operators
implicit operator string(Title)
Implicit cast from Title to string.
public static implicit operator string(Title title)
Parameters
title
TitleTitle to obtain the string representation of.