Salesforce 将String拆分成Char并且替换字符

参考

https://salesforce.stackexchange.com/questions/14987/coverting-a-string-to-array-of-characters

// splitting on empty gives you an array of the string's "chars":
String source = 'foo bar';
String[] chars = source.split('');
// the 1st element in an Apex '' split is garbage; remove it:
chars.remove(0);
System.debug(chars);
// change a char:
chars[6] = 'z';
// prints "foo baz":
System.debug(String.join(chars, ''));

猜你喜欢

转载自blog.csdn.net/rosechan/article/details/79420959
今日推荐