JavaScript Help A string contains words separate by blank sp
JavaScript Help: A string contains words separate by blank spaces. How do you extract the first word?
One example would be:
**Question: Propose an alternative way at producing such a solution.
Solution
<script>
var str=\"The Canadians are now worried about NAFTA\";
var words = str.split(\" \");
document.write(words[0]);
</script>
Output:
The
