【发布时间】:2015-03-03 19:19:46
【问题描述】:
如何在一个单词之后删除 NSString 或 NSArray 的一部分,例如 #gallery-1 或两个“跳行”之后“?而且每次出现的句子都可以删掉吗?
我想删除 #gallery-1 之后或此 NSString(或 NSArray)中的 2 个跳过行之后的所有文本,并删除“CLICK HERE FOR LIVE PEAK WEBCAM”:
3rd March
Swell is 5 foot and cross shore, bitter in the cold wind. Maybe streedagh.
High tide: 1703 3.6m CLICK HERE FOR LIVE PEAK WEBCAM
Low Tide: 1041 0.8m
3 day forecast to March 5th
Good swell all weekend but the winds are changing. Keep in an eye for gaps in the wind.
#gallery-1 {
margin: auto;
}
#gallery-1 .gallery-item {
float: left;
margin-top: 10px;
text-align: center;
width: 50%;
}
#gallery-1 img {
border: 2px solid #cfcfcf;
}
#gallery-1 .gallery-caption {
margin-left: 0;
}
/* see gallery_shortcode() in wp-includes/media.php */
Wind Charts
Wind Guru XC Weather Buoy Weather
Swell Charts
Magic Seaweed MSM WAM Marine Institute
Pressure, Weather, Tides
BBC Pressure Met Eireann Irish Tide Tables
我想获得:
3rd March
Swell is 5 foot and cross shore, bitter in the cold wind. Maybe streedagh.
High tide: 1703 3.6m CLICK HERE FOR LIVE PEAK WEBCAM
Low Tide: 1041 0.8m
3 day forecast to March 5th
Good swell all weekend but the winds are changing. Keep in an eye for gaps in the wind.
【问题讨论】:
-
您查看过
NSString文档吗?有一种方法substringToIndex:可以与rangeOfString:结合使用。 -
@IanMacDonald 我会检查的,谢谢!
标签: ios objective-c nsstring nsarray