![]() |
Problem with uppercase letters :D
Hi all guy!!! I have writing this code but my var word don't count the uppercase letters!!!
HOW TO FIX???? Code:
<!DOCTYPE HTML> |
Try using .toLowerCase()
Quizmaster: A monocracy is a form of government in which how many people rule? Contestant: Twelve. |
Code:
<!DOCTYPE HTML> |
Try RECODING the entire function to be more sensible.
Code:
function alphabet (letter)Code:
function alphabet( letter )Code:
function alphabet( letter )Code:
function alphabet( letter )But *PLEASE* not by making 26 *SEPARATE* tests. |
Of course, there is no reason at all to even need that alphabet function.
Code:
function start () |
I don t see anyone of your method Pedant!!! xD
And your last comment!! It's a mystery for me \s+\... I don't think it's a code for beginner :D However thanks for all example, I'll remember for the next time!!!! |
Quote:
if (arrayPhrase.charAt(i) == ".") Don't know how to works with the array!!! |
My code explained:
Code:
function start () |
Quote:
to access a specific character charAt(nu) is required I tested the script I posted with IE and FF |
Quote:
This is an array!!! I would use an array!!! |
Quote:
Using array notation to reference characters in a string has been recently introduced as an alternative to using charAt but there are still lots of browsers in use that don't support it. |
Quote:
|
Quote:
|
Quote:
When I write array = ["Yehxcwj ecc...."] the programs read this how to one element of array, so when start cicle for (i = 0; i < array.length; i++), the programs execute only one for because the length of array is 0. How to fix this problem!?!?! Beacause my problem ask: " Is stored in an array a text of char. Print the numbers of word, phrase and word for phrase!!!". If I use an simple var the progrma work perfectly :D |
Felgall already answered that question:
Quote:
Code:
var text = arrayPhrase[0];But I strongly suspect you are misreading the homework assignment. Or the instructor just used the wrong words. Maybe you should copy the assignment here *VERBATIM*. |
| All times are GMT +1. The time now is 01:43 PM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.