JCL Help:StrSmartCase@AnsiString@TSysCharSet

From Project JEDI Wiki
Jump to navigationJump to search


Summary

Converts a string to 'smartcase' or 'camelcase'.


Pascal

 function StrSmartCase(const S: string; const Delimiters: TCharValidator): string; overload;
function StrSmartCase(const S: string; const Delimiters: array of Char): string; overload;
function StrSmartCase(const S: AnsiString; Delimiters: TSysCharSet): AnsiString;


Parameters

Parameters Description
const S: string Source string.
const Delimiters: TCharValidator Set of characters to use as delimiters. These characters determine which other characters are uppercased. If you supply an empty set the function assumes you want to use a space only. That is, it sets Delimiters to [' '].


Return Value

The string converted to smart case.


Description

StrSmartCase converts specified characters within the supplied source string to uppercase. The characters that are uppercased are determined by the Delimiters character set. Each time the function finds a character in the source string that is also present in the Delimiters set it uppercases the next character in the source string. In addition, the function always converts the first character to uppercase. For example, if you call StrSmartCase('project jedi rules', [' ']) the function returns 'Project Jedi Rules'. As you can see, all characters that immediately follow a space (as specified by Delimiters) are uppercased.


About

Unit

JclAnsiStrings


Donator

Marcel van Brakel


Notes

Original author is John C Molyneux (jaymol@hotmail.com). Function was rewritten by 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