ACSUtils Wiki

An ACS library for ZDoom-based ports

User Tools

Site Tools


functions:skipcolorcodeat

SkipColorCodeAt

int SkipColorCodeAt(str s, int i)

Description

Skips one colorcode at position i and returns the first index after the skipped colorcode. If there is no colorcode at i, returns i.

Examples

This is how StripColorCodes is implemented:

function str StripColorCodes(str s)
{
	str result = "";
	for (int i = 0; i < StrLen(s); i++)
	{
		i = SkipColorCodeAt(s, i);
		result = StrParam(s:result, c:GetChar(s, i));
	}

	return result;
}
functions/skipcolorcodeat.txt · Last modified: 2017/07/09 17:47 by korshun