snipt

Ctrl+h for KB shortcuts

JavaScript

javascript random string function

function rnd(){ return String((new Date()).getTime()).replace(/\D/gi,'') }
https://snipt.net/embed/d923f96c959900108c17f52b16e46e79/
/raw/d923f96c959900108c17f52b16e46e79/
d923f96c959900108c17f52b16e46e79
js
JavaScript
1
2019-08-14T22:01:44
True
False
False
/api/public/snipt/7565/
javascript-random-string-function
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="kd">function</span> <span class="nx">rnd</span><span class="p">(){</span> <span class="k">return</span> <span class="nb">String</span><span class="p">((</span><span class="k">new</span> <span class="nb">Date</span><span class="p">()).</span><span class="nx">getTime</span><span class="p">()).</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/\D/gi</span><span class="p">,</span><span class="s1">&#39;&#39;</span><span class="p">)</span> <span class="p">}</span> </span></pre></div> </td></tr></table>
javascript, random, string

VB.net

vb consecutive numbering

1
2
3
4
5
6
7
8
Static i As Long 
lStart = 454 

If (i = 0) Then 
    i = lStart 
Else
    i = i+1
End If
https://snipt.net/embed/ddb501d11a8429cc6e8682cac008a275/
/raw/ddb501d11a8429cc6e8682cac008a275/
ddb501d11a8429cc6e8682cac008a275
vb.net
VB.net
8
2019-07-22T14:19:22
True
False
False
/api/public/snipt/1530/
vb-consecutive-numbering
<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> <a href="#L-8">8</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="k">Static</span> <span class="n">i</span> <span class="ow">As</span> <span class="kt">Long</span> </span><span id="L-2"><a name="L-2"></a><span class="n">lStart</span> <span class="o">=</span> <span class="mi">454</span> </span><span id="L-3"><a name="L-3"></a> </span><span id="L-4"><a name="L-4"></a><span class="k">If</span> <span class="p">(</span><span class="n">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">)</span> <span class="k">Then</span> </span><span id="L-5"><a name="L-5"></a> <span class="n">i</span> <span class="o">=</span> <span class="n">lStart</span> </span><span id="L-6"><a name="L-6"></a><span class="k">Else</span> </span><span id="L-7"><a name="L-7"></a> <span class="n">i</span> <span class="o">=</span> <span class="n">i</span><span class="o">+</span><span class="mi">1</span> </span><span id="L-8"><a name="L-8"></a><span class="k">End</span> <span class="k">If</span> </span></pre></div> </td></tr></table>
vb