Template-Plugin-String-Truncate 0. Perl 5. Links CPAN. Author Cory G Watson. Lastest release version 0. Subscribe to package updates Last updated Jul 7th, Manual download of PPM modules Note that although this page shows the status of all builds of this package in PPM, including those available with the free Community Edition of ActivePerl, manually downloading modules ppmx package files is possible only with a Business Edition license.
The remainder of the string is left untouched. To force the string to be all lower case with only the first letter capitalised, you can do something like this:. Removes all leading and trailing whitespace and collapses any sequences of multiple whitespace to a single space.
It's very nice. Click to hide the menu and go all widescreen! Contents Top Close Open. These methods are used to create new String objects. These methods are used to examine the string. Returns the length of the string. These methods modify the internal value of the string. Top Close Open. Removes the suffix passed as an argument from the end of the String. Apply a format in the style of sprintf to the string.
Converts the string to upper case. Converts the first character of the string to upper case. Removes the last character from the string. Removes the trailing newline from the string. Copyright C Andy Wardley. All Rights Reserved. Indents the text block by a fixed pad string or width.
The ' pad ' argument can be specified as a string, or as a numerical value to indicate a pad width spaces. Defaults to 4 spaces if unspecified. Truncates the text block to the length specified, or a default length of Truncated text will be terminated with ' If you want to use something other than ' Repeats the text block for as many iterations as are specified default: 1.
Searches the input text for any occurrences of the specified string and removes them. A Perl regular expression may be specified as the search string.
Similar to the remove filter described above, but taking a second parameter which is used as a replacement string for instances of the search string. An optional binmode argument can follow the filename to explicitly set the output file to binary mode. For the sake of future compatibility and clarity, if nothing else, we would strongly recommend you explicitly use the named binmode option as shown in the first example.
The eval filter evaluates the block as template text, processing any directives embedded within it. This allows template variables to contain template fragments, or for some method to be provided for returning template fragments from an external source such as a database, which can then be processed in the template as required.
The evaltt filter is provided as an alias for eval. The perl filter evaluates the block as Perl code. Thus, the previous example could have been written in the more verbose form:.
0コメント