# truncateString | pokemon-rogue-battle
Documentation for pokemon-rogue-battle

# Function truncateString

- truncateString(str: string, maxLength?: number): string

  Truncate a string to a specified maximum length and add an ellipsis if it exceeds that length.

  #### Parameters

  - str: string

    The string to be truncated.

  - maxLength: number = 10

    The maximum length of the truncated string, defaults to 10.

  #### Returns string

  The truncated string with an ellipsis if it was longer than maxLength.

  - Defined in src/utils.ts:494