How to access the tokenized value in Java -


i have tokenized string, want access 1st,2nd,3rd value it.

can this?

thanks in advance!

here code

string cssvalue = webdriver.findelement(by.id(elementid)).getcssvalue("color"); string s = cssvalue; stringtokenizer st = new stringtokenizer(s, ",() "); while (st.hasmoretokens()) {      log.info("token: "+st.nexttoken()); } 

this might help:

string cssvalue = webdriver.findelement(by.id(elementid)).getcssvalue("color"); string [] s = cssvalue.split("rgb"); stringtokenizer st = new stringtokenizer(s[1], ",() "); list<integer> values = new arraylist<integer>(); int index=0; while (st.hasmoretokens()) {   values.add(integer.parseint(st.nexttoken()));   log.info("token: "+values.get(index));   index++;  } integer [] = values.toarray(new integer[3]); 

Comments

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -