Categories > Original > Essay > Coding

modulu and substring

by iluvdacomalfoy 0 reviews

stuff

Category: Essay - Rating: G - Genres: Angst - Published: 2014-11-27 - 73 words

0Unrated
modulu- remainder something%something
The number part is a little strange. To select for the "he" in "hello", you would write this:

"hello". substring(0, 2);
Each character in a string is numbered starting from 0, like this:

0 1 2 3 4
| | | | |
h e l l o
The letter h is in position 0, the letter e is in position 1, and so on.

Therefore if you start at position 0, and slice right up till position 2, you are left with just he
Sign up to rate and review this story