# Generator

Faker allows you to create data collections with all the available functions of the library, this function is called generator. The generator function receives a tuple of functions called `items` and the name of a function called `separator`, which will be in charge of joining the result of the execution of the functions and adding a character between them.

```rust
Faker.generator(
	items=(
		Faker.user_name()
		,Faker.first_name()
		,Faker.city()
		,Faker.postcode()
		,string(Faker.user_name(),"@",Faker.domain_name())
	)
	, separator=Faker.string
)
=> Cira.BalistreriSadieThielbury00743Johnson.Marci@mas.name
```

```rust
Faker.generator(
	items=(
		Faker.user_name()
		,Faker.first_name()
		,Faker.city()
		,Faker.postcode()
		,string(Faker.user_name(),"@",Faker.domain_name())
	)
	, separator=Faker.stringWithSpaces
)
=> SKris Leota New Joe 35420-2738 UPadberg@ngac.com

```

```rust
Faker.generator(
	items=(
		Faker.user_name()
		,Faker.first_name()
		,Faker.city()
		,Faker.postcode()
		,string(Faker.user_name(),"@",Faker.domain_name())
	)
	, separator=Faker.stringWithComa
)
=> Dean12, Eugene, Port Palmer, 74355, zStokes@ji.info

```

## Separator custom

It is possible to create a custom function that defines our own separator character.

```rust
stringCustom(a::String,b::String)::String = string(a," - ",b)

Faker.generator(
	items=(
		Faker.user_name()
		,Faker.first_name()
		,Faker.city()
		,Faker.postcode()
		,string(Faker.user_name(),"@",Faker.domain_name())
	)
	, separator=stringCustom
)

=> lStamm - Judith - West Fernanda - 87842 - Bergstrom.Althea@klah.org

```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://neomatrixcode.gitbook.io/faker/guide/generator.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
