Organizational Research By

Surprising Reserch Topic

Experts Most Trusted Topic


what is the best way to extract the first word from a string in java using -'java,string'


what is the best way to extract the first word from a string in java  using -'java,string'

Trying to write a short method so that I can parse a string and extract the first word. I have been looking for the best way to do this.

I assume I would use str.split(","), however I would like to grab just the first first word from a string, and save that in one variable, and and put the rest of the tokens in another variable.

Is there a concise way of doing this?
    

asked Sep 7, 2015 by rajesh
0 votes
6 views



Related Hot Questions



Government Jobs Opening


...