JCL Help:StrExpandTabs@string@Integer

From Project JEDI Wiki
Jump to navigationJump to search


Summary

Expands tabs to spaces in the provided string.


Parameters

Parameters Description
S The string to expand tabs in.
TabWidth The width of each tab.


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

StrExpandTabs expands tab characters in the provided string into sequences of spaces while preserving the formatting. StrExpandTabs will use the provided tab width.
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.
The reverse operation (collapse sequences of spaces into tab characters) can be achieved by the StrOptimizeTabs method.


Examples

x := StrExpandTabs('Abc'#9'de'#9'fg', 8);The above call will result in x containing the string (· represents a space character): Abc·····de······fg. In this case the first tab character (ASCII code 9) was transformed into five spaces and the second tab character into six spaces.


See Also

TJclTabSet StrExpandTabs@string StrExpandTabs@string@TJclTabSet


About

Donator

Marcel Bestebroer


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