Range (computer programming): Difference between revisions

Content deleted Content added
Ksp-atlas (talk | contribs)
m top: Fixed grammar - have -> has
Tags: Mobile edit Mobile app edit Android app edit App full source
Line 60:
</syntaxhighlight>
 
[[Rust (programming language)|Rust]] havehas a built-in range struct in the standard library in {{Mono|std::ops::Range}}.<ref>{{cite web |title=Range in std::ops - Rust |url=https://doc.rust-lang.org/std/ops/struct.Range.html |website=doc.rust-lang.org |access-date=17 October 2024}}</ref>
 
== Range as a operator ==
[[Rust (programming language)|Rust]] havehas the {{Mono|..}} and {{Mono|..{{=}}}} operators.
<syntaxhighlight lang="rust">
let heartwarming = "heartwarming!".to_string();
Line 69:
</syntaxhighlight>
 
[[Zig (programming language)|Zig]] also havehas the {{Mono|..}} operator.
<syntaxhighlight lang="zig">
// To iterate over consecutive integers, use the range syntax.