我想要拆分逗号SQLite数据库内 [英] I want to split comma inside SQLite database

查看:163
本文介绍了我想要拆分逗号SQLite数据库内的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想里面SQLite数据库拆分逗号。 我有一个Product_ code在一个产品表中的两个product_ code型。 可以看看图片产品表product_ code柱有两个PRODCUT type.How我能做到这一点?

I want to split comma inside SQLite database. I have two product_code type in one Product_code in one Product table. can look at the picture Product table product_code column have two prodcut type.How I can do this?

推荐答案

哟可以分割产品code与

yo can split productCode with ,

String productCodes = cursor.getString(cursor.getColumnIndex("product_code"));  
String[] codes = productCodes.split(",");  

String code1 = codes[0]);
String code2 = codes[1]);



//for (String code: codes )  
// {  
//    System.out.println(code);  
// }  

这篇关于我想要拆分逗号SQLite数据库内的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆