Thread: String.format

    #1
  1. Looking for something to do
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2004
    Posts
    715
    Rep Power
    12

    String.format


    Hi,

    I was thinking of using string.format to get this effect

    original string "myhouse"
    result string "my-house"

    but I just dont seem to get it to work. Any suggestions?
    Kenped
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2012
    Location
    Cluj-Napoca, Romania
    Posts
    3
    Rep Power
    0
    Are you talking about this?

    Code:
    string s = "myhouse";
    string n = string.Format("{0}-{1}", s.Substring(0, 2), s.Substring(2));

IMN logo majestic logo threadwatch logo seochat tools logo