String.Format(). How to change new?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Veronika14
    New Member
    • Sep 2014
    • 1

    #1

    String.Format(). How to change new?

    how to change the format 9202566684 on +7(920) 256-66-84?
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    Something like this would work:
    Code:
    String original = "9202566684"
    String.Format("+7({0}} {1}-{2}-{3}", original.Substring(0, 2), original.Substring(3, 5), original.Substring(5, 2),original.Substring(6, 7), original.Substring(8,9));
    -Frinny

    Comment

    Working...