StringIndexOutOfBoundsException: length=2; regionStart=2; regionLength=2 android : Error    String index out of bound exception i don't know how to solve it.. Please Help me in solving this issue


 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.muhammadshan.bmi/com.example.muhammadshan.bmi.result}: **java.lang.StringIndexOutOfBoundsException: length=2; regionStart=2; regionLength=2**
                      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
                      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
                      at android.app.ActivityThread.-wrap11(ActivityThread.java)
                      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
                      at android.os.Handler.dispatchMessage(Handler.java:102)
                      at android.os.Looper.loop(Looper.java:148)
                      at android.app.ActivityThread.main(ActivityThread.java:5417)
                      at java.lang.reflect.Method.invoke(Native Method)
                      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
                   Caused by: java.lang.StringIndexOutOfBoundsException: length=2; regionStart=2; regionLength=2
                      at java.lang.String.startEndAndLength(String.java:298)
                      at java.lang.String.substring(String.java:1087)
                      at com.example.muhammadshan.bmi.height.getSelectedHeight(height.java:89)
                      at com.example.muhammadshan.bmi.result.onCreate(result.java:38)
                      at android.app.Activity.performCreate(Activity.java:6237)
                      at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
                      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
                      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) 
                      at android.app.ActivityThread.-wrap11(ActivityThread.java) 
                      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) 
                      at android.os.Handler.dispatchMessage(Handler.java:102) 
                      at android.os.Looper.loop(Looper.java:148) 
                      at android.app.ActivityThread.main(ActivityThread.java:5417) 
                      at java.lang.reflect.Method.invoke(Native Method)`[enter code here][1]`


  [1]: https://i.stack.imgur.com/h5UDh.png