mirror of
https://github.com/meshtastic/python.git
synced 2026-02-23 18:17:08 -05:00
1.2.13
This commit is contained in:
@@ -37,8 +37,9 @@ blacklistVids = dict.fromkeys([0x1366])
|
||||
|
||||
|
||||
def stripnl(s):
|
||||
"""remove newlines from a string"""
|
||||
return str(s).replace("\n", " ")
|
||||
"""remove newlines from a string (and remove extra whitespace)"""
|
||||
s = str(s).replace("\n", " ")
|
||||
return ' '.join(s.split())
|
||||
|
||||
|
||||
def fixme(message):
|
||||
@@ -160,14 +161,15 @@ class DeferredExecution():
|
||||
<span>def <span class="ident">stripnl</span></span>(<span>s)</span>
|
||||
</code></dt>
|
||||
<dd>
|
||||
<div class="desc"><p>remove newlines from a string</p></div>
|
||||
<div class="desc"><p>remove newlines from a string (and remove extra whitespace)</p></div>
|
||||
<details class="source">
|
||||
<summary>
|
||||
<span>Expand source code</span>
|
||||
</summary>
|
||||
<pre><code class="python">def stripnl(s):
|
||||
"""remove newlines from a string"""
|
||||
return str(s).replace("\n", " ")</code></pre>
|
||||
"""remove newlines from a string (and remove extra whitespace)"""
|
||||
s = str(s).replace("\n", " ")
|
||||
return ' '.join(s.split())</code></pre>
|
||||
</details>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
Reference in New Issue
Block a user