[SR-2131] The empty string is not a prefix/suffix of itself (or any string) #44739
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
feature
A feature request or implementation
standard library
Area: Standard library umbrella
Additional Detail from JIRA
md5: d4b6fd317e1bd24e83fe8dec7117f5da
Issue Description:
Inspired by https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20160718/024896.html.
Currently, the empty string has unique prefix/suffix behavior compared to other strings:
This is consistent with NSString and Foundation but conflicts with other languages and with concatenation - for all non-empty strings
a
andb
,(a+b)
has a prefix ofa
and a suffix ofb
.The text was updated successfully, but these errors were encountered: