From a514bfa97cff2c9b8a127d80a271d19c39f44a73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Wed, 8 May 2013 11:10:46 -0600 Subject: [PATCH] Improve specs and docs for String module --- lib/elixir/lib/string.ex | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/elixir/lib/string.ex b/lib/elixir/lib/string.ex index 0375198880..14644bf297 100644 --- a/lib/elixir/lib/string.ex +++ b/lib/elixir/lib/string.ex @@ -505,11 +505,12 @@ defmodule String do { "j", "osé" } """ - @spec next_grapheme(t) :: grapheme | :no_grapheme + @spec next_grapheme(t) :: { grapheme, t } | :no_grapheme defdelegate next_grapheme(string), to: String.Unicode @doc """ - Returns the first grapheme from an utf8 string. + Returns the first grapheme from an utf8 string, + nil if the string is empty. ## Examples @@ -528,7 +529,8 @@ defmodule String do end @doc """ - Returns the last grapheme from an utf8 string. + Returns the last grapheme from an utf8 string, + nil if the string is empty. ## Examples