#include <iostream>
#include "uCalc.h"

using namespace std;
using namespace uCalcSoftware;

int main() {
   uCalc uc;
   {
      uCalc::String s("A B C");
      s.Owned(); // Causes s to be released when it goes out of scope

      // Case 1: Pattern is at the start. Should return an empty string.
      cout << "Before 'A': '";
      cout << s.Before("A");
      cout << "'" << endl;

      // Case 2: Pattern does not exist. Should return an empty string.
      cout << "Before 'D': '";
      cout << s.Before("D");
      cout << "'" << endl;

      // Case 3: Get text before the last word.
      cout << "Before 'C': '";
      cout << s.Before("C");
      cout << "'" << endl;
   }
}