phpjs
Version:
112 lines (87 loc) • 3.31 kB
HTML
<!-- Generated by Rakefile:build -->
<strong>
<a href="http://an3m1.com/" rel="nofollow">???? ????????</a>
</strong>
on 2012-04-23 14:51:39 <br />
If I might —perhaps you should consider adding a few images. I don’t mean to disrespect what you’ve said ; its very enlightening, indeed. However, I think would respond to it more positively if they could be something tangible to your ideas
<hr />
<strong>
<a href="http://brett-zamir.me" rel="nofollow">Brett Zamir</a>
</strong>
on 2011-09-14 10:53:39 <br />
@Dennis: Though I agree that could be useful in some situations, we are following PHP behavior.
<hr />
<strong>
<a href="http://oto-studio.com" rel="nofollow">Dennis</a>
</strong>
on 2011-09-13 17:17:57 <br />
there is a mistake: the func wont turn THIS into This. So you should first make the entire string tolowercase.. fix.. publishing this comment is unnecessary
<hr />
<strong>
Dj
</strong>
on 2011-07-16 18:49:11 <br />
Why just dont use:
<pre><code>
return str.charAt(0).toUpperCase() + str.substr(1);
</code></pre>
instead of assign the value to f to later return it
<hr />
<strong>
Lucas Souza
</strong>
on 2010-07-26 16:43:04 <br />
Thank you, man. That was really helpful.
<hr />
<strong>
<a href="http://kevin.vanzonneveld.net" rel="nofollow">Kevin van Zonneveld</a>
</strong>
on 2009-01-13 01:42:41 <br />
@ Brett Zamir: Beautiful man. If you keep this pace you may even beat Onno ;)
Hm, wrong page, but strange that your previous post didn't come through. There is nothing in my spamfilter. Maybe you had different tabs open, so that captcha didn't match (there's one valid per session), and you closed the tab without noticing. Happened to me once :)
<hr />
<strong>
<a href="http://bahai-library.com" rel="nofollow">Brett Zamir</a>
</strong>
on 2009-01-12 01:42:35 <br />
Here's lcfirst... It looks like you don't need the 2nd argument to substr (also in ucfirst) when you are extracting to the end...
<pre><code>
function lcfirst( str ) {
// http://kevin.vanzonneveld.net
// * example 1: lcfirst('Kevin Van Zonneveld');
// * returns 1: 'kevin Van Zonneveld'
str += '';
var f = str.charAt(0).toLowerCase();
return f + str.substr(1);
}
alert(lcfirst('Kevin Van Zonneveld'))</code></pre>
and here's strcspn (for measuring the length of continuous sentences spoken by guests on C-SPAN):
<pre><code>function strcspn (str, mask, start, length) {
start = start ? start : 0;
var count = (length &amp;&amp; ((start + length) &lt; str.length)) ? start + length : str.length;
strct:
for (var i=start, lgth=0; i &lt; count; i++) {
for (var j=0; j &lt; mask.length; j++) {
if (str[i].indexOf(mask[j]) !== -1) {
continue strct;
}
}
++lgth;
}
return lgth;
}
</code></pre>
<hr />
<strong>
<a href="http://kevin.vanzonneveld.net" rel="nofollow">Kevin van Zonneveld</a>
</strong>
on 2009-03-08 19:55:55 <br />
What you're describing sounds more like ucwords().
Please check the PHP manual.
<hr />
<strong>
Zorg
</strong>
on 2009-03-05 07:02:50 <br />
That isn't how ucfirst works in PHP, ucfirst makes the first letter of EVERY word uppercase... not just the first letter of the string.
<hr />