scrollHorizontal

To scroll a line, by an xOffset

Can be used to scroll to right, or to left (by making xOffset negative). Can also be used to fill an empty line with empty space (' ') to make it fill width, if line.length < width

Arguments: * line is the full line * xOffset is the number of characters scrolled right * width is the number of characters that are to be displayed

Return Value

Type: char[]

the text that should be displayed

Examples

st{
	assert("0123456789".scrollHorizontal(5, 2) == "56");
	assert("0123456789".scrollHorizontal(0,10) == "0123456789");
	assert("0123456789".scrollHorizontal(10,4) == "    ");
	assert("0123456789".scrollHorizontal(-5,4) == "    ");
	assert("0123456789".scrollHorizontal(-5,6) == "     0");
	assert("0123456789".scrollHorizontal(-1,11) == " 0123456789");
	assert("0123456789".scrollHorizontal(-5,10) == "     01234"

Meta