Difference between using StringTokenizer and Strin

2019-02-01 23:21发布

This question already has an answer here:

I've been using String[] split(String) of String class to split any string for some given delimiter, and it worked fine.

However, now it is expected to re-factor the same logic with StringTokenizer. But what are the differences and benifits of using one over the other.

Also, I feel that String[] returned by split() in a single call is much efficient option than using the objects of the class StringTokenizer.

7条回答
【Aperson】
2楼-- · 2019-02-02 00:16

Here is a link answering (from my point of view) the question: http://lavnish.blogspot.com/2008/05/stringsplit-vs-stringtokenizer.html

查看更多
登录 后发表回答