Snipt.net is closing on December 31st, 2016

For more information, please visit this blog post.

snipt

Ctrl+h for KB shortcuts

C#

Format Double

double d = 123.123456789;
d.tostring("F")  // 123.12
https://snipt.net/embed/1f5b40b6339f4bf629a7cb80daa5cda3/
https://snipt.net/raw/1f5b40b6339f4bf629a7cb80daa5cda3/
1f5b40b6339f4bf629a7cb80daa5cda3
csharp
C#
2
2016-12-04T18:26:40
True
False
False
/api/public/snipt/26043/
format-double
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="kt">double</span> <span class="n">d</span> <span class="p">=</span> <span class="m">123.123456789</span><span class="p">;</span> </span><span id="L-2"><a name="L-2"></a><span class="n">d</span><span class="p">.</span><span class="n">tostring</span><span class="p">(</span><span class="s">&quot;F&quot;</span><span class="p">)</span> <span class="c1">// 123.12</span> </span></pre></div> </td></tr></table>
c#, double, netduino, number, string

Text only

use double brackets for compound and regex test

1
2
3
4
5
6
7
# Use Double Brackets for Compound and Regex Tests
http://hacktux.com/bash/script/efficient

The [ or test builtins can be used to test expressions, but the [[ builtin operator additionally provides compound commands and regular expression matching.

if [[ expression1 || expression2 ]]; then do_something; fi
if [[ string =~ regex ]]; then do_something; fi 
https://snipt.net/embed/48e2e9eaa7681a5d794a5744aa3fa370/
https://snipt.net/raw/48e2e9eaa7681a5d794a5744aa3fa370/
48e2e9eaa7681a5d794a5744aa3fa370
text
Text only
7
2016-12-04T18:27:40
True
False
False
/api/public/snipt/10525/
use-double-brackets-for-compound-and-regex-test
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a> <a href="#L-6">6</a> <a href="#L-7">7</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a># Use Double Brackets for Compound and Regex Tests </span><span id="L-2"><a name="L-2"></a>http://hacktux.com/bash/script/efficient </span><span id="L-3"><a name="L-3"></a> </span><span id="L-4"><a name="L-4"></a>The [ or test builtins can be used to test expressions, but the [[ builtin operator additionally provides compound commands and regular expression matching. </span><span id="L-5"><a name="L-5"></a> </span><span id="L-6"><a name="L-6"></a>if [[ expression1 || expression2 ]]; then do_something; fi </span><span id="L-7"><a name="L-7"></a>if [[ string =~ regex ]]; then do_something; fi </span></pre></div> </td></tr></table>
and, brackets, compound, double, for, regex, test, use
Copyrighted, illegal, or inappropriate content? Email [email protected].