我想在sqlite中替换部分字符串。 SUBSTR
我有一个名为name的列表。
无论名字从Matt开始,我都想用John替换它。
例如: "马特史密斯"去约翰史密斯"
答案 0 :(得分:1)
替换实际上会给你一个
REPLACE("Matt Smith", "Matt", "John")
答案 1 :(得分:0)
你可以试试这个:
final String[] whereArgs = { "Matt%" };
final ContentValues args = new ContentValues();
args.put(NAME_COLUMN, "John");
int columnsUpdated = this.sqlitedatabase.update(YOUR_TABLE,args,"where name like ?", whereArgs);