I need to solve the following question which i can’t get to work by myself(newbie^^)..:
Ok, the question: Create a method which will print the central letter of a string (given as a parameter). I need to use the property lenght to determine the lenght.
So for example the string: Books. the middle/central letter is o.
Hope its a bit clear..
Thanks in advance.
Edit: I know how to determine the lenght of the string. Now the problem is to divide the word and then write down the next letter or something.
Here are some tips:
1. Type string has a
Lengthproperty.2 .If you know the index of the character you want, you can ask for it using:
myString[index].3. Knowing what to do with string that has even number of characters is necessary to answer that question.
4. Consider integer devision.
That should get you started.