JCL Help:StrEnsureSuffix@AnsiString@AnsiString

From Project JEDI Wiki
Jump to navigationJump to search


Summary

Forces Text to end with Suffix.


Pascal

 function StrEnsureSuffix(const Suffix: string; const Text: string): string;
function StrEnsureSuffix(const Suffix: AnsiString; const Text: AnsiString): AnsiString;


Parameters

Parameters Description
const Suffix: string The suffix to test for and apply.
const Text: string The string which must be forced to have a suffix.


Return Value

The function result is a copy of the supplied Text, with the suffix.


Description

StrEnsureSuffix tests whether the supplied text ends in the supplied suffix. If it doesn't then the suffix is appended to the string otherwise the function does nothing. Note that if Text is an empty string then the result will be Suffix.


See Also

StrEnsureNoSuffix StrEnsurePrefix


About

Unit

JclAnsiStrings


Donator

Marcel van Brakel


Contribute to this help topic

This documentation wiki is based on the collaborative effort of Project JEDI users. Your edits are welcome in order to improve documentation quality: edit this page