How to custom format a String C #?

0

Having a string like this:

String texto = "123456890";

How can I make the screen output look like this:

(123)4567890
    
asked by Manuel Hdez Galván 15.04.2017 в 21:40
source

1 answer

2

Using the String.format method of the class String

String texto = "123456890";
MessageBox.Show(String.Format("{0:(###) ######}", Convert.ToInt64(texto));
    
answered by 15.04.2017 / 21:49
source