JCL Help:StrBefore@AnsiString@AnsiString

From Project JEDI Wiki
Jump to navigationJump to search


Summary

Returns the portion of the string before a specific sub-string.


Pascal

 function StrBefore(const SubStr: string; const S: string): string;
function StrBefore(const SubStr: AnsiString; const S: AnsiString): AnsiString;


Parameters

Parameters Description
const SubStr: string The sub-string to search for.
const S: string The source string.


Return Value

The portion of the string before the specified sub-string. If the sub-string does not appear in the source string the result is the source string.


Description

The StrBefore routine returns that portion of the specified string that appears before a specified sub-string. For example, StrBefore('world', 'Hello world') returns the string 'Hello '.


See Also

StrAfter


About

Unit

JclAnsiStrings


Donator

Anthony Steele


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