We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
The % operator is used for performing the modulo operation on two numeric types.
%
1 % 2
The % operator can be defined for non-numeric types or type combinations with the following:
func __modulus__(a $A, b $B) $C
where $A, $B and $C are any valid types
$A
$B
$C
See __modulus__ for more information.
__modulus__
A common usage of the % operator (for non-numeric types) is simple String substitution:
String
"Welcome %!" % "Isaac"
Allowed by these definitions:
func __modulus__(lhs POD String, rhs String) String func __modulus__(lhs POD String, rhs int) String func __modulus__(lhs POD String, rhs ptr) String func __modulus__(lhs POD String, rhs bool) String func __modulus__(lhs POD String, rhs $T~__primitive__) String
Table of Contents