You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: index.html
+4-1Lines changed: 4 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -432,8 +432,11 @@
432
432
<int> = <str>.find(<sub_str>) <spanclass="hljs-comment"># Returns start index of first match or -1.</span>
433
433
<int> = <str>.index(<sub_str>) <spanclass="hljs-comment"># Same but raises ValueError if missing.</span>
434
434
</code></pre>
435
+
<pre><codeclass="python language-python hljs"><bool> = <str>.isdecimal() <spanclass="hljs-comment"># True if str contains only [0-9], [٠-٩], …</span>
436
+
<bool> = <str>.isdigit() <spanclass="hljs-comment"># Also true if str contains '¹²³…'.</span>
437
+
<bool> = <str>.isnumeric() <spanclass="hljs-comment"># Also true if str contains '¼½¾…'.</span>
438
+
</code></pre>
435
439
<pre><codeclass="python language-python hljs"><str> = <str>.replace(old, new [, count]) <spanclass="hljs-comment"># Replaces 'old' with 'new' at most 'count' times.</span>
436
-
<bool> = <str>.isnumeric() <spanclass="hljs-comment"># True if str contains only numeric characters.</span>
437
440
<list> = textwrap.wrap(<str>, width) <spanclass="hljs-comment"># Nicely breaks string into lines.</span>
0 commit comments