开发者

Android query to extract first word from a field

So I've been dragging with this on开发者_如何学运维e for some time now and simply can't find the solutions

Let's say I have a table called NAME with values like John Doe Jane Doe etc.

I just want to pull the first word.... so everything after the first space ' ' will not show I'm pulling the data into a Cursor as it's over 2000 records

Any thoughts on a raw query that will do such a thing? Thanks in advance Yeshai


You just get the string from db as a string and use something like

String[] strs = dbString.split(" ");

str[0] should be what you need.
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜