JCL Help:TJclTabSet.Expand@string

From Project JEDI Wiki
Jump to navigationJump to search


Summary

Expands tabs to spaces in the provided string.


Pascal

 public function Expand(const S: string): string; overload;


Parameters

Parameters Description
const S: string The string to expand tabs in.


Return Value

If S contains tabs, they will have been converted to 1 or more space characters, depending on the column the tab character is in. Otherwise, the string is unmodified.


Description

Expand expands tab characters in the provided string into sequences of spaces while preserving the formatting. Expand will assume the string starts at column 0 (zero-based set to True) or 1 (zero-based set to False).
Multi-line strings, ie. strings containing one or more newline sequences (eg. CrLf, but also single Cr of Lf characters are treated as newlines), are handled properly, with each line starting at column 0 (zero-based set to True) or 1 (zero-based set to False).
The reverse operation (collapse sequences of spaces into tab characters) can be achieved by the Optimize method.


Examples

See the TJclTabSet help for an example.


See Also

TJclTabSet TJclTabSet.Expand@string@SizeInt


About

Donator

Marcel Bestebroer


Notes

This method is nil-safe; when invoked on a nil-reference, this method will assume a tab width of two on a zero-based tab set.


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