开发者

apache commons lang StrTokenizer

开发者 https://www.devze.com 2023-02-04 17:51 出处:网络
Since I need empty tokens to read either as empty string or null, I decided to use the apache common开发者_如何学Pythons lang StrTokenizer

Since I need empty tokens to read either as empty string or null, I decided to use the apache common开发者_如何学Pythons lang StrTokenizer But I am still not able to get the empty string. I know I need to set the setEmptyTokenAsNull method before I tokenize. But how can I do that? Please help.

tok = new StrTokenizer(line,","); 
tok.setEmptyTokenAsNull(true);


Got it!! Used tok.setIgnoreEmptyTokens(false); instead!!

0

精彩评论

暂无评论...
验证码 换一张
取 消