Ruby/Powrót do prostych przykładów: Różnice pomiędzy wersjami

Usunięta treść Dodana treść
Nie podano opisu zmian
Kj (dyskusja | edycje)
m +nav
Linia 162:
 
Look again at the last part of line 12. st and en were defined in lines 1-2 as the ANSI sequences that make text color-inverted and normal, respectively. In line 12 they are enclosed in #{} to ensure that they are actually interpreted as such (and we do not see the variable names printed instead). Between these we see \\&. This is a little tricky. Since the replacement string is in double quotes, the pair of backslashes will be interpreted as a single backslash; what gsub actually sees will be \&, and that happens to be a special code that refers to whatever matched the pattern in the first place. So the new string, when displayed, looks just like the old one, except that the parts that matched the given pattern are highlighted in inverse video.
<noinclude>
{{ProstaNawigacja|spis=Ruby|poprzart=Ruby/Tablice|poprz=Tablice|nastart=Ruby/Struktury sterujące|nast=Struktury sterujące}}
</noinclude>