Sympa::Tools::Text(3Sympa)

NAME
Sympa::Tools::Text - Text-related functions

DESCRIPTION
This package provides some text-related functions.

  Functions

wrap_text ( $text, [ $init_tab, [ $subsequent_tab, [ $cols ] ] ] )
    Function. Returns line-wrapped text.

    Parameters:

    $text
        The text to be folded.

    $init_tab
        Indentation prepended to the first line of paragraph. Default is '', no indentation.

    $subsequent_tab
        Indentation prepended to each subsequent line of folded paragraph. Default is '', no indentation.

    $cols
        Max number of columns of folded text. Default is 78.

foldcase ( $str )
    Function. Returns "fold-case" string suitable for case-insensitive match. For example, a code below looks for a needle in haystack not regarding case, even if they are non-ASCII UTF-8 strings.

      $haystack = Sympa::Tools::Text::foldcase($HayStack);
      $needle   = Sympa::Tools::Text::foldcase($NeedLe);
      if (index $haystack, $needle >= 0) {
          ...
      }

    Parameter:

    $str
        A string.