Content deleted Content added
Salix alba (talk | contribs) →Range as a operator: add C# range operator |
|||
Line 77:
}
</syntaxhighlight>
As does [[C Sharp (programming language)|C#]]<ref>{{cite web|last1=BillWagner|access-date=2025-02-22|title=Explore ranges of data using indices and ranges - C#|url=https://learn.microsoft.com/en-us/dotnet/csharp/tutorials/ranges-indexes|date=14 November 2023|website=learn.microsoft.com}}</ref>
<syntaxhighlight lang="C#">
string items[] = ["one","two","three","four"];
string first_three_items[] = items[0..2];
</syntaxhighlight>
[[Python (programming language)|Python]] and [[PHP (programming language)|PHP]] does not have any range operator but they do have a {{Code|range}} function.<ref>{{cite web |title=Built-in Functions |url=https://docs.python.org/3/library/functions.html#func-range |website=Python documentation |publisher=Python Software Foundation |access-date=17 December 2024 |language=en}}</ref><ref>{{cite web |title=PHP: range - Manual |url=https://www.php.net/manual/en/function.range.php |publisher=The PHP Documentation Group |access-date=17 December 2024}}</ref>
|