The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Nile::Filter - Filter functions for Nile framework.

SYNOPSIS

    $filter = $me->filter;
    
    # trim leading and traling spaces
    $str = $filter->trim($str);
    

DESCRIPTION

Nile::Filter - Filter functions for Nile framework.

trim()

    $str = $filter->trim($str);
    @str = $filter->trim(@str);

Remove white spaces from left and right of a string.

ltrim()

    $str = $filter->ltrim($str);
    @str = $filter->ltrim(@str);

Remove white spaces from left of a string.

rtrim()

    $str = $filter->rtrim($str);
    @str = $filter->rtrim(@str);

Remove white spaces from right of a string.

trims()

    $str = $filter->trims($str);
    @str = $filter->trims(@str);

Remove all white spaces from a string.

strip_html()

    $str = $filter->strip_html($str);

Remove all html tags from a string.

disable_html()

    $str = $filter->disable_html($str);

Disable all html tags in a string.

escape_html()

    $str = $filter->escape_html($str);

Encode entities ' " & < > in string.

strip_script()

    # remove <script...>...</script> tags
    $str = $filter->strip_script($str);

Remove script tags from a string.

quotemeta()

    $str = $filter->quotemeta($str);

Returns all the ASCII non-"word" characters backslashed.

uc()

    $str = $filter->uc($str);

Upper case the string letters.

lc()

    $str = $filter->lc($str);

Lower case the string letters.

ucfirst()

    $str = $filter->ucfirst($str);

Upper case the first letter in a string.

lcfirst()

    $str = $filter->lcfirst($str);

Lower case the first letter in a string.

email()

    $valid_email = $filter->email('ahmed@email.com');

Returns the valid email or undef if not passed.

uri()

    $valid_url = $filter->uri('http://www.domain.com/path/file');

Returns the valid url or undef if not passed.

digit()

    $digits = $filter->digit($str);

Removes none digits from string and converts to integer.

number()

    $str = "data -123.45678";
    $number = $filter->number($str);
    say $number; # -123.45678

Converts string to number.

commify()

    $number = 12345678;
    $commified = $filter->commify($number);
    say $commified; # 12,345,678

Format numbers with commas nicely for easy reading.

Bugs

This project is available on github at https://github.com/mewsoft/Nile.

HOMEPAGE

Please visit the project's homepage at https://metacpan.org/release/Nile.

SOURCE

Source repository is at https://github.com/mewsoft/Nile.

SEE ALSO

See Nile for details about the complete framework.

AUTHOR

Ahmed Amin Elsheshtawy, احمد امين الششتاوى <mewsoft@cpan.org> Website: http://www.mewsoft.com

COPYRIGHT AND LICENSE

Copyright (C) 2014-2015 by Dr. Ahmed Amin Elsheshtawy احمد امين الششتاوى mewsoft@cpan.org, support@mewsoft.com, https://github.com/mewsoft/Nile, http://www.mewsoft.com

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.