TokenLeft

TokenLeft
string TokenLeft(string full, string tokens, int pos)

Documentation

Useful for grabbing the leftmost tokens of a string. Requires the function, GetTokenPosX.

Example Usage

string TokenLeft(string full, string tokens, int pos) // Excludes token
// Pass: Full string, token delimiters, token to be left of.
// Return: A string returning tokens left of the specified token offset.
// Requires: GetTokenPosX
// Assumes: pos > 0
{
	if (pos < 1) return "";
	pos = GetTokenPosX(full, tokens, pos, 0);
	if (pos == len(full)) return full;
	else return left(full, pos);
}
Talkback

There are no talkbacks on this documentation page yet. Post the first?

Post a new comment?

Doc Nav

Your docs
View All Docs

If you log in, you can edit the documentation, or create your own documents and tutorials!

Ben McGraw's lovingly crafted this website from scratch for years.
It's a lot prettier this go around because of Jon Wofford.
Verge-rpg.com is a member of the lunarnet irc network, and would like to take this opportunity to remind you that regardless how babies taste, it is wrong to eat them.