Variable string inherits from string
//StitchingNsmutablestring *string= [nsmutablestringstring]; [stringAppendString:@"Today Sunday"]; NSLog (@"%@",string);//Today Sunday//insert (in which position to insert what?) )[stringInsertstring:@"That 's a meow."Atindex:0]; NSLog (@"%@",string);//it's a meow. Today Sunday//DeleteNsrange range = Nsmakerange (4,2); [stringDeletecharactersinrange:range]; NSLog (@"%@",string);//meow, Sunday.
/*given a picture file name, determine whether the string ends with "png", if it is replaced by "JPG", if not, splicing ". jpg". */nsmutablestring*string= [nsmutablestringstring]; //Stitching[stringAppendString:@"Mei Cool Heart"];//decide whether to end with PNGif([stringHassuffix:@"PNG"]) { //string ends with "PNG" and replaced with "JPG"[stringStringbyreplacingoccurrencesofstring:@"PNG"Withstring:@"jpg"];}Else{ //string not ending with "PNG", splicing ". jpg"[stringAppendString:@". jpg"];} NSLog (@"%@",string);//Meian Center. jpg
Variable string nsmutablestring