$fill

$fill

Welcome to our Knowledge Base

Documentation | Blog | Demos | Support

< All Topics
Print

$fill

$fill

Fills part of a string with a specified character

Syntax

$fill(source,position,length,string)

Parameters

sourcea character string, or an expression that evaluates to a character string
positiona number, or an expression that evaluates to a number
lengtha number, or an expression that evaluates to a number
stringa character string, or an expression that evaluates to a character string

Return Value

Character string, consisting of source filled with the first character from string, starting at position, for a length of length.

Comments

Use $fill to initialize strings to specific values. The function fills source with the (first) character from string, starting at position, for length number of characters. The fill character replaces any characters that already exist in the string in the specified positions.

In a string, the position of the first character is always 1. If position is beyond the end of source, or if position is zero or negative, then source is left unchanged.

If length is zero or negative, then source is left unchanged.

If there are fewer than length characters from position to the end of source, then all characters from position to the end of source are replaced by the fill character.

If string is the null string, then a space is used as the fill character.

Example

$fill(Title,1,$length(Title),” “)

The above expression fills Title with spaces.

See Also

$concat

$delete

$insert

$left

$position

$replace

$right

$squeeze

$substring

$translate

About Character Literals

About Functional Expressions

Was this article helpful?
0 out of 5 stars
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
5
How can we improve this article?
Please submit the reason for your vote so that we can improve the article.

Leave a Reply

Your email address will not be published. Required fields are marked *

en_CAEnglish