mirror of
https://github.com/Fechin/reference.git
synced 2026-11-27 07:58:57 +03:00
chore: some copies have been modified.
This commit is contained in:
1 parent
04ab180f13
commit
4b8b64906d
6 files changed
+15
-15
No files matched your search
@@ -227,8 +227,8 @@ String s = 3 + 3 + 23; // Incompatible types
|
||||
### Comparison
|
||||
|
||||
```java
|
||||
String s1 = new String("QuickRef");
|
||||
String s2 = new String("QuickRef");
|
||||
String s1 = new String("cheatsheets.zip");
|
||||
String s2 = new String("cheatsheets.zip");
|
||||
|
||||
s1 == s2 // false
|
||||
s1.equals(s2) // true
|
||||
|
||||
@@ -984,8 +984,8 @@ See also: [Nullsafe Operator](https://wiki.php.net/rfc/nullsafe_operator)
|
||||
### Regular expressions
|
||||
|
||||
```php
|
||||
$str = "Visit Quickref.me";
|
||||
echo preg_match("/qu/i", $str); # => 1
|
||||
$str = "Visit cheatsheets.zip";
|
||||
echo preg_match("/ch/i", $str); # => 1
|
||||
```
|
||||
|
||||
See: [Regex in PHP](/regex#regex-in-php)
|
||||
|
||||
@@ -155,9 +155,9 @@ message += "Part 2."
|
||||
### f-Strings (Python 3.6+)
|
||||
|
||||
```python
|
||||
>>> website = 'Quickref.ME'
|
||||
>>> website = 'cheatsheets.zip'
|
||||
>>> f"Hello, {website}"
|
||||
"Hello, Quickref.ME"
|
||||
"Hello, cheatsheets.zip"
|
||||
|
||||
>>> num = 10
|
||||
>>> f'{num} + 10 = {num + 10}'
|
||||
@@ -509,9 +509,9 @@ True
|
||||
### f-Strings usage
|
||||
|
||||
```python
|
||||
>>> website = 'Quickref.ME'
|
||||
>>> website = 'cheatsheets.zip'
|
||||
>>> f"Hello, {website}"
|
||||
"Hello, Quickref.ME"
|
||||
"Hello, cheatsheets.zip"
|
||||
|
||||
>>> num = 10
|
||||
>>> f'{num} + 10 = {num + 10}'
|
||||
|
||||
Reference in new issue
Block a user