Skip to content

Commit

Permalink
New method: deleteEnterFromString()
Browse files Browse the repository at this point in the history
  • Loading branch information
perezzini committed Nov 28, 2017
1 parent e7782f3 commit 8662b39
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions utils.sig
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,7 @@ sig

(* Converts a Splaymap dict to string *)
val dictToString : ('a, 'b) Splaymap.dict -> ('a -> string) -> ('b -> string) -> string

(* Deletes last enter from a string *)
val deleteEnterFromString : string -> string
end
4 changes: 4 additions & 0 deletions utils.sml
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,8 @@ struct
pairToString pair aToString bToString)
end

fun deleteEnterFromString str =
String.substring(str, 0, (String.size str) - 1)
handle Subscript => raise Fail "Error - deleteEnterFromString()"

end

0 comments on commit 8662b39

Please sign in to comment.