Characteristics of strings

xiaoxiao2021-03-06  39

1, Chinese string width is 1, if you want to value the value, you need a function

S1 = "China" console.writeline (s1.length) console.writeline (system.text.encoding.default.getbytecount (s1)) 'Gets the width of the Chinese character 2, the REPLACE operation of the string will generate a new string, Unlike the original string

S1 = "123" Console.writeline (S1.GetHashcode ()) Console.Writeline (S1.Replace ("1", "!!!!") Console.Writeline (S1) Console.writeline (S1.GETHASHCODE ())

result

123193359061 !!!! 23123193359061

转载请注明原文地址:https://www.9cbs.com/read-117711.html

New Post(0)