how to devide 1 string to 2 conceptuALLY PART?

Discussion in 'Mac Programming' started by saleh.hi.62, Nov 19, 2011.

  1. saleh.hi.62 macrumors member

    Joined:
    Jul 25, 2011
    #1
    Hello guys,

    Code:
    NSString *webpage;
    [webPage writeToFile:@"[COLOR="SeaGreen"]/saleh/[/COLOR][COLOR="Red"]http://www.yahoo.com/index.html[/COLOR]"
    							atomically:YES encoding:NSUTF8StringEncoding error:&theError];
    in this command i am trying to write the content of webpage variable to an HTML file.

    Code:
    [webPage writeToFile:@"[COLOR="SeaGreen"]/saleh/[/COLOR][COLOR="Red"]http://www.yahoo.com/index.html[/COLOR]"
    here /saleh is my path and i must to specify the file name after path.

    Problem:
    Code:
    [COLOR="Red"]http://www.yahoo.com/index.html[/COLOR]
    this my url, i would like to save my file with this name after path, but the problem is that, it is not capable of recognizing /http://www.yaHOO.com/index.html that is not a path! but its a file name!

    how can i specify that after /saleh/
    this string totally is my filename not the path!!!

    Code:
    [COLOR="Red"]http://www.yahoo.com/index.html[/COLOR]
     
  2. KnightWRX, Nov 19, 2011
    Last edited: Nov 19, 2011

    KnightWRX macrumors Pentium

    KnightWRX

    Joined:
    Jan 28, 2009
    Location:
    Quebec, Canada
    #2

Share This Page