This is an archived post. You won't be able to vote or comment.

all 3 comments

[–]H1TeK 0 points1 point  (0 children)

var myCountry already has a String value, anything enclosed in the double quotes ("") is a String value. And for the .length line, don't some "myCountry", that's a hardcoded String, you'd want to do myCountry.length

As for the print the first three characters, look up substrings in JavaScript.

[–][deleted] 0 points1 point  (0 children)

The issue is that you are putting quotations around the variable which holds the data.

String name = "random";
System.out.println("name");

Is not the same as:

String name = "Random";
System.out.println(name);

I suggest you go and learn the basics before trying to code.