let index_of_character t ?(from=0) c = let from = if from <= 0 then 0 else min (length t) from in try Some (String.index_from t from c) with _ -> None