Important bug fix and some new developments.

- Added a method "lastCharIndex" to assist in the following bugfix:
- Fixed a bug where if the text string has just one decimal point,
anther decimal point cannot be added.
- Began work on the btnSwitch case in the switch statement.