Click to See Complete Forum and Search --> : Parts of a string


Webskater
02-26-2003, 10:54 AM
I am using:
var FirstChar = RefNo.slice(0,1);
to establish what the first character of the RefNo string is. How can I refer to what's left - all the characters after the first character. Thanks.

Charles
02-26-2003, 11:33 AM
<script type="text/javascript">
<!--
alert('Workers of the world unite. You have nothing to lose but your chains.'.split('')[13]);
// -->
</script>

Charles
02-26-2003, 11:36 AM
Or did you want what follows?

<script type="text/javascript">
<!--
if (/^.(.*)/.test('Workers of the world unite. You have nothing to lose but your chains.')) alert (RegExp.$1);
// -->
</script>