Generates a random string containing only lowercase alphabetical characters.

Creates a string of specified length using only characters a-z. Each character is independently randomly selected, so the same character may appear multiple times. Useful for generating random identifiers, test names, or placeholder text.

  RandomGenerator.alphabets(5);  // "hello"
RandomGenerator.alphabets(3); // "abc"
RandomGenerator.alphabets(10); // "randomtext"

// Generate random CSS class names
const className = `test-${RandomGenerator.alphabets(6)}`;

// Create random variable names for testing
const varName = RandomGenerator.alphabets(8);
  • Parameters

    • length: number

      The desired length of the generated alphabetic string

    Returns string

    A string containing only lowercase letters of the specified length