Skip to content

Commit

Permalink
estring:startswith for vsn 1.7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
japerk committed Jun 17, 2010
1 parent 61a05c1 commit b2c0245
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ebin/elib.app
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{application, elib, [
{description, "Extended Erlang library modules"},
{vsn, "1.7.0"},
{vsn, "1.7.1"},
{mod, {elib, []}},
{registered, [elib_sup, timeout_server]},
{applications, [kernel, stdlib]},
Expand Down
4 changes: 3 additions & 1 deletion ebin/elib.appup
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{"1.7.0", [
{"1.7.1", [
% upgrade instructions
{"1.7.0", [{load_module, estring}]},
{"1.6.4", [
{load_module, erlport_server},
{add_module, round_robin_server}
Expand Down Expand Up @@ -46,6 +47,7 @@
{"1.5.10", [{load_module, etable}]}
], [
% downgrade instructions
{"1.7.0", [{load_module, estring}]},
{"1.6.4", [
{load_module, erlport_server},
{delete_module, round_robin_server}
Expand Down
4 changes: 3 additions & 1 deletion src/estring.erl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

-module(estring).

-export([endswith/2, format/2, lower/1, shared_prefix/2]).
-export([startswith/2, endswith/2, format/2, lower/1, shared_prefix/2]).
-export([join/2, read_file/1, random/1]).
-export([split/2, splitc/2, tokenize/2]).
-export([replace/3, replace_all/3]).
Expand All @@ -28,6 +28,8 @@
-export([urldecode/1, querydecode/1]).
-export([is_utf8/1, encode_utf8/1, utf8_to_unicode/1]).

startswith(S, Prefix) -> lists:prefix(Prefix, S).

endswith(S, Suffix) ->
case string:right(S, length(Suffix)) of
Suffix -> true;
Expand Down

0 comments on commit b2c0245

Please sign in to comment.