import os, strutils, osproc, sequtils, algorithm proc cutBetween(str, a, b: string): string = let cutA = str.find(a) cutB = str.find(b) if cutA == -1 or cutB == -1: return "" return str[cutA + a.len..