Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void TextInterpolate(char *Out, const char *In, char Prefix, const char *ReplaceThis, const char *ReplaceWith[]) {
- while(*In) {
- if(*In != Prefix)
- *(Out++) = *(In++);
- else {
- In++;
- char *Find = strchr(ReplaceThis, *(In++));
- if(Find) {
- int This = Find - ReplaceThis;
- strcpy(Out, ReplaceWith[This]);
- Out += strlen(ReplaceWith[This]);
- } else {
- *(Out++) = Prefix;
- *(Out++) = In[-1];
- }
- }
- }
- *Out = 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement