java - select positions of value of string or int -
i'm trying select positions of value , print parts of value position in java when i'm working on android app. example if have number four-digit, 4375 if select 3rd 1 system print 7, 4th 1 system print 5..
you can select portion of string string.substring() methods. see https://docs.oracle.com/javase/7/docs/api/java/lang/string.html more help.
hence, convert digit string , use substring() method part want.
i provide solution suggestion:
private string getsubdigit(int value, int postion){ // should check if value correct , ready processed. if(check(value)) { string temp = "" + value; return temp.substring(position,position+1); }else{ return ""; } }
Comments
Post a Comment