(* aux.sml *) (* Copyright (C) 2006 Alley Stoughton This file is part of crypto, a cryptogram encoder/decoder. See the file COPYING.txt for copying and usage restrictions *) (* auxiliary functions *) structure Aux :> AUX = struct fun lastPartOfPath x = Substring.string (#2(Substring.splitr (fn c => Char.isAlpha c orelse Char.isDigit c orelse c = #"-" orelse c = #"_") (Substring.full x))) fun removeLeadingTrailingSpace x = let val (_, x) = Substring.splitl Char.isSpace (Substring.full x) val (x, _) = Substring.splitr Char.isSpace x in Substring.string x end; end;