Module

String

Changes by version

Elixir 1.19.0

· 2 changes

Enhancement Tool: Elixir

Add String.count/2 to count occurrences of a pattern

Enhancement Tool: Elixir

Update to Unicode 17.0.0

Elixir 1.18.0

· 2 changes

Enhancement Tool: Elixir

Inspect special whitespace and zero-width characters using their Unicode representation

Enhancement Tool: Elixir

Update Unicode to 16.0

Elixir 1.17.0

· 1 change

Enhancement Tool: Elixir

Add String.byte_slice/3 to slice a string to a maximum number of bytes while keeping it UTF-8 encoded

Elixir 1.16.1

· 1 change

Bugfix Tool: Elixir

Fix String.capitalize/1 with a single codepoint

Elixir 1.16.0

· 3 changes

Enhancement Tool: Elixir

Update to Unicode 15.1.0

Enhancement Tool: Elixir

Add String.replace_invalid/2

Hard Deprecation Tool: Elixir

Deprecate passing a range with negative step on String.slice/2, give first..last//1 instead

Elixir 1.15.0

· 2 changes

Enhancement Tool: Elixir

Update Unicode to version 15.0.0

Enhancement Tool: Elixir

Add :fast_ascii mode to String.valid?/2

Elixir 1.14.1

· 1 change

Enhancement Tool: Elixir

Fix String.split/3 and String.next_grapheme/1 returning invalid results on invalid UTF-8 encoding

Elixir 1.14.0

· 4 changes

Enhancement Tool: Elixir

Support empty lookup lists in String.replace/3, String.split/3, and String.splitter/3

Enhancement Tool: Elixir

Allow slicing with steps in String.slice/2

Bugfix Tool: Elixir

Allow slices to overflow on both starting and ending positions

Hard Deprecation Tool: Elixir

Deprecate passing a binary compiled pattern to String.starts_with?/2

Elixir 1.13.3

· 1 change

Bugfix Tool: Elixir

Fix error for certain codepoint combinations in String.split_at/2

Elixir 1.13.1

· 1 change

Bugfix Tool: Elixir

Fix incorrect codepoint byte counting in slice with negative positions in ranges

Elixir 1.13.0

· 1 change

Bugfix Tool: Elixir

Update Unicode database to version 14.0

Elixir 1.12.0

· 2 changes

Enhancement Tool: Elixir

Add :turkic mode option to String case functions

Enhancement Tool: Elixir

Update to Unicode 13.0

Elixir 1.10.3

· 1 change

Bugfix Tool: Elixir

Undeprecate String.normalize/2 normalize and fix infinite loop caused by certain invalid strings

Elixir 1.10.0

· 2 changes

Enhancement Tool: Elixir

Update to Unicode 12.1

Enhancement Tool: Elixir

String.normalize/2 has been deprecated in favor of :unicode.characters_to_nfc_binary/1 or :unicode.characters_to_nfd_binary/1 which ship as part of Erlang/OTP 20+

Elixir 1.9.0

· 1 change

Enhancement Tool: Elixir

The :insert_replaced option in String.replace/4 has been deprecated. Instead you may pass a function as a replacement or use :binary.replace/4 if you need to support earlier Elixir versions

Elixir 1.8.0

· 2 changes

Enhancement Tool: Elixir

Add String.bag_distance/2

Bugfix Tool: Elixir

Fix ZWJ handling in Unicode grapheme clusters

Elixir 1.7.0

· 1 change

Enhancement Tool: Elixir

Update to Unicode 11

Elixir 1.6.6

· 1 change

Bugfix Tool: Elixir

Add performant impl for string upcase/downcase :ascii mode

Elixir 1.6.0

· 5 changes

Enhancement Tool: Elixir

Update to Unicode 10

Enhancement Tool: Elixir

Allow passing empty string match to String.replace/4

Enhancement Tool: Elixir

Support context and language sensitive operations in String.upcase/2 and String.downcase/2. Currently only the :greek context is supported

Enhancement Tool: Elixir

Support :ascii conversion in String.upcase/2 and String.downcase/2

Bugfix Tool: Elixir

Return a leading empty space when splitting on empty string. This makes the split operation consistent with the other operations in the String module

Elixir 1.5.0

· 6 changes

Enhancement Tool: Elixir

Optimise binary pattern matching in String.split/1 and String.trim_*/1

Bugfix Tool: Elixir

Consider Unicode non-characters valid according to the specification in String.valid?/1

Enhancement Tool: Elixir

String.ljust/3 and String.rjust/3 are deprecated in favor of String.pad_leading/3 and String.pad_trailing/3 with a binary padding

Enhancement Tool: Elixir

String.strip/1 and String.strip/2 are deprecated in favor of String.trim/1 and String.trim/2

Enhancement Tool: Elixir

String.lstrip/1 and String.rstrip/1 are deprecated in favor of String.trim_leading/1 and String.trim_trailing/1

Enhancement Tool: Elixir

String.lstrip/2 and String.rstrip/2 are deprecated in favor of String.trim_leading/2 and String.trim_trailing/2 with a binary as second argument

Elixir 1.4.2

· 1 change

Bugfix Tool: Elixir

Incorporate new grapheme rules in Unicode 9

Elixir 1.4.0

· 2 changes

Enhancement Tool: Elixir

Update to Unicode 9.0.0

Bugfix Tool: Elixir

Fix infinite recursion in String.replace_leading/3 and String.replace_trailing/3 when given an empty string

Elixir 1.3.0

· 5 changes

Enhancement Tool: Elixir

Add String.myers_difference/2 for calculating the difference between two strings

Bugfix Tool: Elixir

Ensure strip also removes non-breaking whitespaces (and ensure split still does not split on them)

Enhancement Tool: Elixir

The confusing String.strip/2, String.lstrip/2 and String.rstrip/2 API has been soft deprecated in favor of String.trim/2, String.trim_leading/2 and String.trim_trailing/2

Enhancement Tool: Elixir

The confusing String.ljust/3 and String.rjust/3 API has been soft deprecated in favor of String.pad_leading/3 and String.pad_trailing/3

Enhancement Tool: Elixir

String.valid_character?/1 is deprecated in favor of String.valid?/1 with pattern matching

Elixir 1.2.6

· 1 change

Bugfix Tool: Elixir

Fix a bug in NFD normalization when followed by one-byte sized graphemes

Elixir 1.2.5

· 1 change

Enhancement Tool: Elixir

Fix bugs in String.replace_* functions where it would not include the accumulated value for certain replacements

Elixir 1.2.4

· 3 changes

Enhancement Tool: Elixir

Update version of the Unicode database to 8.0.0

Enhancement Tool: Elixir

Ensure split/1 does not break on non-breakable whitespace

Enhancement Tool: Elixir

Ensure NFC and NFD normalization pass all of Unicode 8.0.0 tests

Elixir 1.2.3

· 2 changes

Enhancement Tool: Elixir

Fix incomplete data trimming on both String.replace_trailing and String.rstrip

Enhancement Tool: Elixir

Attach debug_info back into Unicode modules for Dialyzer support

Elixir 1.2.0

· 3 changes

Enhancement Tool: Elixir

Introduce String.replace_{prefix,suffix,leading,trailing}/2. The first two will replace only the first occurrence of the given match in string. The last two will replace all occurrences of the given match

Enhancement Tool: Elixir

Support String.normalize/2 and String.equivalent?/2 that perform NFD and NFC normalization

Bugfix Tool: Kernel

Ensure UnicodeConversionError does not contain invalid string in its error message

Elixir 1.1.0

· 3 changes

Enhancement Tool: Elixir

Support calculation of the jaro distance between strings (usually names) via String.jaro_distance/2. This is used by Mix to support "Did you mean?" feature when a task does not exist

Enhancement Tool: Elixir

Add String.splitter/3 that splits strings as a stream

Enhancement Tool: Elixir

Passing an empty string to starts_with?, contains? and ends_with? had dubious behaviour and have been deprecated to help developers identify possible bugs in their source code

Elixir 1.0.5

· 3 changes

Enhancement Tool: Elixir

Optimize String.rstrip/1

Enhancement Tool: Elixir

Optimize String.downcase/1

Enhancement Tool: Elixir

Optimize String.upcase/1

Elixir 1.0.3

· 1 change

Enhancement Tool: Elixir

Fix LFCR being treated as a grapheme instead of CRLF

Elixir 1.0.2

· 1 change

Enhancement Tool: Elixir

Fix String.replace/4 typespec

Elixir 0.15.0

· 2 changes

Enhancement Tool: Elixir

String.slice/2 and String.slice/3 have been optimized

Enhancement Tool: Elixir

\NNN, \NN and \N for octals are deprecated inside string, sigils and chars in favor of hexadecimal entries with \x

Elixir 0.14.3

· 1 change

Enhancement Tool: Elixir

Improve performance of String.split/1

Elixir 0.14.1

· 2 changes

Enhancement Tool: Elixir

Updated Unicode database to 7.0

Enhancement Tool: Elixir

String.slice/2 and String.slice/3 always returns a list (and never nil)

Elixir 0.14.0

· 1 change

Enhancement Tool: Elixir

Add String.chunk/2

Elixir 0.13.3

· 2 changes

Enhancement Tool: Elixir

String.from_char_data/1 and String.from_char_data!/1 deprecated in favor of List.to_string/1

Enhancement Tool: Elixir

String.to_char_list/1 (previously deprecated) no longer returns a tuple but the char list only and raises in case of failure

Elixir 0.13.2

· 2 changes

Enhancement Tool: Elixir

Support :parts in String.split/3

Enhancement Tool: Elixir

Deprecate :global option in String.split/3 in favor of parts: :infinity

Elixir 0.13.1

· 2 changes

Enhancement Tool: Elixir

String.to_char_list/1 is deprecated in favor of List.from_char_data/1 (this is a soft deprecation, no warnings will be emitted)

Enhancement Tool: Elixir

String.from_char_list/1 is deprecated in favor of String.from_char_data/1 (this is a soft deprecation, no warnings will be emitted)

Elixir 0.12.2

· 1 change

Enhancement Tool: Elixir

Change String.next_grapheme/1 and String.next_codepoint/1 to return nil on string end

Elixir 0.11.0

· 4 changes

Enhancement Tool: Elixir

Update to Unicode 6.3.0

Enhancement Tool: Elixir

Add String.slice/2 with a range

Enhancement Tool: Elixir

Implement the extended grapheme cluster algorithm for String operations

Enhancement Tool: Elixir

String.to_integer/1 and String.to_float/1 are deprecated in favor of Integer.parse/1 and Float.parse/1

Elixir 0.10.3

· 2 changes

Enhancement Tool: Bug fixes

Fix a bug with String.split/2 when given an empty pattern

Enhancement Tool: Deprecations

String.valid_codepoint?/1 is deprecated in favor of pattern matching with <<_ :: utf8 >>

Elixir 0.10.2

· 4 changes

Enhancement Tool: Elixir

Add regex pattern support to String.replace/3

Enhancement Tool: Elixir

Add String.ljust/2, String.rjust/2, String.ljust/3 and String.rjust/3

Enhancement Tool: Elixir

String.strip/2 now supports removing unicode characters

Enhancement Tool: Elixir

String.slice/3 still returns the proper result when there is no length to be extracted

Elixir 0.10.1

· 2 changes

Enhancement Tool: Elixir

Add Regex.scan/3 now supports capturing groups

Enhancement Tool: Elixir

Add String.reverse/1