Comparison of programming languages (string functions): Difference between revisions

Content deleted Content added
m std::format in C++ 20
c++ 20 and c++ 23 string changes
Line 290:
|-
| <code>''string<sub>1</sub>'' <=> ''string<sub>2</sub>''</code>
|[[Ruby (programming language)|Ruby]], [[C++]] (STL, [[C++20]])<ref>In C++, the overloaded [https://en.cppreference.com/w/cpp/language/operator_comparison#Three-way%20comparison <code>operator<=></code>] method on a [https://en.cppreference.com/w/cpp/string/basic_string string] returns a [https://en.cppreference.com/w/cpp/utility/compare/strong_ordering <code>std::strong_ordering</code>] object (otherwise <code>std::weak_ordering</code>): <code>less</code>, <code>equal</code> (same as <code>equivalent</code>), or <code>greater</code>.</ref>
|[[Ruby (programming language)|Ruby]]
|-
| <code>''string<sub>1</sub>''.compare(''string<sub>2</sub>'')</code>
Line 628:
|-
| <code>''string''.contains(''substring'')</code>
| [[Cobra (programming language)|Cobra]], [[Java (programming language)|Java]] (1.5+), [[Raku (programming language)|Raku]], [[Rust (programming language)|Rust]]<ref>See the [https://doc.rust-lang.org/stable/std/primitive.str.html#method.contains <code>str::contains</code>] method.</ref>, [[C++]] ([[C++23]])<ref>See the [https://en.cppreference.com/w/cpp/string/basic_string/contains <code>std::basic_string::contains</code>] method.</ref>
|-
| <code>''string''.indexOf(''substring'') &gt;= 0</code>
Line 1,191:
| <code>std::format(''formatstring'', ''items'')</code>
|
| [[C++|]] ([[C++20]])
|Python
|-