hej
det er sådan at jeg er i gang med at lærer js, og er ind på den her
hjemmeside, og det er sådan at jeger kommet til en øvelse som jeg har lidt svært ved, (
dog skal ikke løse den for mig men dog der i mode forklare mig eller sige til mig hvad jeg gøre glat??)
Der bliver skrevet sådan her til mig i den;
We've learned a few ways to manipulate numbers. What about manipulating strings?
Sometimes you don't want to display the entire string, just a part of it. For example, in your Gmail inbox, you can set it to display the first 50 or so characters of each message so you can preview them. This preview is a substring of the original string (the entire message).
Code:
"some word".substring(x, y) where x is where you start chopping and y is where you finish chopping the original string.
The number part is a little strange. To select for the "he" in "hello", you would write this: "hello". substring(0, 2);
Think of there being a marker to the left of each character, like this: 0-h-1-e-2-l-3-l-4-o-5.
If you chop at 0 and again at 2 you are left with just he.
More examples:
1. First 3 letters of "Batman"
"Batman".substring(0,3)
2. From 4th to 6th letter of "laptop"
"laptop".substring(3,6)
Find the 4th to 7th letter of the string "wonderful day".Jeg har skrevet sådan her i kode
- "wonderful day".substring(4,7);
Håber du kan hjælp mig frem til hvad jeg gøre galt?, dog skal du bare sige hvad jeg har gjort galt, f.eks kigge et eller andet stede ...