Click to See Complete Forum and Search --> : Help!!!!


Dr1ft3r
12-04-2002, 04:07 PM
Hey whats up ya know how i wanted to detect the first letter before? Well i used that (thanks for the help) and now i want to detect the whole first word of the phrase....any help?

Charles
12-04-2002, 04:18 PM
<script type="text/javascript">
<!--
a = 'Fee, fie, foe and fum'.split(/\b/);
alert(a[0]);
// -->
</script>

Dr1ft3r
12-04-2002, 04:31 PM
this is what i meant....i want a user to enter a phrase into a text box and then they hit "go" and it detects the first whole word of that phrase....any help there?

and also can you detect the 2nd and 3rd etc. etc. etc. words of the phrase...this would help me ALOT...thanks

Charles
12-04-2002, 04:35 PM
The script above demonstrates how to split a string on the word boundries. What more do you need?

Be aware, however, that if you are relying upon JavaScript then your page will fall flat on it's face for between one in ten and one in five users. What server side languages do you have access to?

Dr1ft3r
12-04-2002, 04:42 PM
sorry i misunderstood the code...i got it now...thanks alot:D