In my program I need to add a character to my string and then print it on the console. In my case, the number will not be always the same, but will always have 2 characters. I need to add a ' , ' to the mid position, but I don't know how. (I'm very beginner, please post an example code). An example is, I want to turn "25" to "2,5". Thanks for your help. [sorry for bad english, also the title can be pretty bad/misleading]
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
- How to know full paths to DLL's from .csproj f
Based on your requirement (will always have 2 characters) You can use
Insert
method. Like this:But if it has more than 2 characters you can append the
,
in the middle of the string like this: