Hi,

I understand the potential confusion stemming from .subview() not returning a view, but a string.
Although I'd also urge people to read up on functions before assuming what it does, we could also try to come up with what it does.
I agree with an earlier point that .slice() sounds like it might actually slice the string, which is not the case, therefore I suggest .sliced().

I'd like to keep the name concise, since part of my point in the paper is that this new function would lead to less code written at times, and making the function name very explicit defeats the purpose of writing less code.

Personally, my preference remains at .subview(), and if such confusion arises during code-reviews (for example), you're always only 1 cppreference link away from the answer.
However, I think .sliced() is a reasonable alternative if the majority of this mailing list feels that .subview() is misleading.

Sincerely,

Op wo 27 mrt 2024 om 02:51 schreef Sebastian Wittmeier via Std-Proposals <std-proposals@lists.isocpp.org>:

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substr

 

.substr seems to be deprecated? And never been intended to be part of EcmaScript?
 

-----Ursprüngliche Nachricht-----
Von: Zhihao Yuan <zy@miator.net>
As a prior art, JavaScript String provides both .substr and
.substring methods, where the prior accepts (start, count)
and the latter accepts (start, end).
--
Std-Proposals mailing list
Std-Proposals@lists.isocpp.org
https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals


--
Rhidian De Wit
Software Engineer - Barco