NAME

AmberDB::String - String manipulation, HTML conversion, and text sanitization utility

SYNOPSIS

use AmberDB::String;
my $str_util = AmberDB::String->new();

my $truncated = $str_util->sub_str($long_text, 50);
my $html      = $str_util->text2html($plain_text);
my $clean     = $str_util->html2text($html_content);

DESCRIPTION

AmberDB::String inherits from AmberDB::Locale and provides utility methods for string truncation, HTML tag stripping, entity escaping, and bidirectional conversion between plain text and HTML.

METHODS

new()

Constructor for AmberDB::String.

sub_str($string, $length)

Truncates a string to specified length, ending with " ...".

trim_space($string)

Removes leading, trailing, and redundant internal whitespace characters.

remove_tags($data)

Strips HTML tags while preserving line breaks.

text2html($text)

Converts plain text to HTML with paragraph tags and line breaks.

html2text($html)

Converts HTML formatted content back into plain text.

AUTHOR

Maruf Cetin <marufcetin@gmail.com>

LICENSE AND COPYRIGHT

Copyright (C) 2017-2026 Maruf Cetin.

This library is free software; you can redistribute it and/or modify it under the terms of the Artistic License 2.0.