我有一个像112.1或102.2等字符串现在我想在点之前和使用目标c的点之后得到子字符串,意味着我想获得像这样的112和1的2个子串.请指导.关心萨阿德.
我正在使用此代码从我的ipad应用程序的数据库中删除一行,
-(BOOL) removeSegmentWithSegmentId:(NSInteger)sId
{
AppDelegate *appDelegate = (AppDelegate *) [[UIApplication sharedApplication] delegate];
sqlite3_stmt *statement;
NSString *removeKeyword =[NSString stringWithFormat:@"DELETE FROM segment WHERE segment.segment_id = %d",sId];
const char *query = [removeKeyword UTF8String];
NSLog(@"%@",removeKeyword);
//if(sqlite3_prepare_v2(appDelegate->globalConnection,[removeKeyword UTF8String] , -1, &statement, NULL) == SQLITE_OK)
if(sqlite3_prepare_v2(appDelegate->globalConnection,query , -1, &statement, NULL) == SQLITE_OK)
{
if(sqlite3_step(statement) == SQLITE_DONE) {
sqlite3_finalize(statement);
return YES;
}
}
return NO;
}
Run Code Online (Sandbox Code Playgroud)
但它不起作用,有人可以指导我吗?