• Log in or sign up for an account here: https://www.sythe.org/login

GetBetween (get between two strings!)

Blupig

BEEF TOILET

$5 USD Donor
Joined
Nov 23, 2006
Sythe Gold
1,609
Messages
7,145
Location
Canada
Discord Unique ID
178533992981594112
Valentine's Singing Competition Winner
Sythe Awards 2015 Winner
Sythe Awards 2016 Winner
Sythe Awards 2020 Winner
Member of the Month Winner
MushyMuncher
Gohan has AIDS
Extreme Homosex
World War 3
I'm LAAAAAAAME
Discord Verified
Off Topic Participant
I use this function way too often in VB, C#, etc, whenever I'm parsing, and to my dismay I found nothing like it on Google, so I made my own.

Voila:

Code:
string getBetween(string fullstring, string start, string end)
{
	int spos = fullstring.find(start) + start.length();
	int epos = fullstring.find(end);

	int length = (epos - spos);

	return fullstring.substr(spos, length);
}

Uses the <string> header
 
duelarena.gg
Back
Top