> For the complete documentation index, see [llms.txt](https://sacro.gitbook.io/syllabore/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sacro.gitbook.io/syllabore/class-docs/nameformatter.md).

# NameFormatter

A convenience class used for modeling names that have multiple parts and need multiple generators to create them.

*Implements: Archigen.IGenerator\<System.String>*

## Constructors

| Constructor                         | Description                                                                                                                                                                                                                                                                                                                                                                                  |
| ----------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| NameFormatter(System.String format) | Instantiates a new [NameFormatter](/syllabore/class-docs/nameformatter.md) with the specified format. Substrings that need to be replaced with a generated name should be surrounded with curly brackets. For example, the format "John {middle-name} Smith" tells a [NameFormatter](/syllabore/class-docs/nameformatter.md) that the name between the first and last needs to be generated. |

## Methods

| Method                                                                                                                                                                               | Returns                                                 | Description                                                            |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------- | ---------------------------------------------------------------------- |
| Define(System.String propertyName, Archigen.IGenerator \<System.String> nameGenerator, [NameFormat](/syllabore/class-docs/nameformat.md) stringCase, System.Boolean useLeadingSpace) | [NameFormatter](/syllabore/class-docs/nameformatter.md) |                                                                        |
| Next()                                                                                                                                                                               | System.String                                           | Returns a new generated name based on the previously specified format. |

## Properties

| Property            | Type                                                                                                                                           | Description                                                                                                                                                                                                                                                                                              |
| ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| BoundNameGenerators | System.Collections.Generic.Dictionary \<System.String,Archigen.IGenerator \<System.String>>                                                    | The [NameGenerator](/syllabore/class-docs/namegenerator.md) used by this [NameFormatter](/syllabore/class-docs/nameformatter.md).                                                                                                                                                                        |
| Format              | System.String                                                                                                                                  | The desired format for names. Surround substrings that need to be replaced with a generated name with curly brackets. For example, the format "John {middle-name} Smith" tells a [NameFormatter](/syllabore/class-docs/nameformatter.md) that the name between the first and last needs to be generated. |
| Options             | System.Collections.Generic.Dictionary \<System.String,[NameFormatterGeneratorOptions](/syllabore/class-docs/nameformattergeneratoroptions.md)> | Provides hints on whether a name should be upper case, lower case, capitalized, etc.                                                                                                                                                                                                                     |
