在java中有constantPool常量池,常量池里对类,方法,接口的常量,而对于存放字符串常量通常存放的符号链接Symbol 或者真实的String的对象的引用. 我们来看一段简单的代码和反编译字节码 public class test { public static void main(String[] args) { String test = "test"; } } Constant pool: #1 = Class #2 // test #2 = Utf8 test #3
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace StringFormatEfficiency { class Program { static void Main(string[] args) { string format = "my {0} is {1}"; string name = "name"; string zh
Convert List, string. A List can be converted to a string. This is possible with the ToArray method on the List type. We can also convert a string into a List.ConversionsThe StringBuilder type helps with certain conversions, which are done with loops