android字符串 优化(一)

android字符串优化

1.String.format

String sql = String.format("insert into cheese values(\" %s \",\" %s \")",name,origion)

2.StringBuilder

StringBuilder builder = new StringBuilder();

builder.append("INSERT INTO cheese values ...");

String sql = builder.toString();


StringBuilder 速度比String.format 快

2.StringBuilder


2.StringBuilder

你可能感兴趣的:(android字符串 优化(一))