Bỏ qua

StringGenerator generator

Warning

The current page still doesn't have a translation for this language.

But you can help translating it: Contributing.

Generate strings with configurable length, character set, uniqueness, prefix, and suffix.

Why: Use StringGenerator for bounded synthetic strings with an explicit alphabet and optional affixes; use RegexStringGenerator when the entire lexical shape is best expressed as a regular expression.

Category: core.

Output: str.

1
<key name="value" generator="StringGenerator(min_len=8, max_len=12, char_set='ABC123', prefix='T-', suffix='-X')"/>

Parameters

  • min_len: int | null; Default None — Inclusive minimum length of the generated body.
  • max_len: int | null; Default None — Inclusive maximum length of the generated body.
  • char_set: str | null; Default None — Non-empty alphabet sampled for the generated body.
  • unique: bool; Default False — Whether values must be unique within the supported in-process pool.
  • prefix: str | null; Default None — Constant text prepended to the generated body.
  • suffix: str | null; Default None — Constant text appended to the generated body.