#import <UIKit/UIKit.h>
#import "AppDelegate.h" int main(int argc, char * argv[]) {
NSString *str=@"Hello OC";//普通字符定义
NSString *str1=[NSString stringWithFormat:@"Number is %d",];//工厂方法格式化字符串
NSString *str2=[NSString stringWithContentsOfURL:[NSURL URLWithString:@"http://netcorner.cnblogs.com"] encoding:NSUTF8StringEncoding error:nil];//会同步执行程序,就是网页执行完以后才能执行后面的程序 NSLog(@"%@",str2); NSLog(@"%@",[str substringFromIndex:]);//调用NSString的方法,如果要查看看多,请查看帮助文档,菜单->Help->Documentation and API Reference }

oc字符串的用法的更多相关文章

  1. Delphi中stringlist分割字符串的用法

    Delphi中stringlist分割字符串的用法 TStrings是一个抽象类,在实际开发中,是除了基本类型外,应用得最多的. 常规的用法大家都知道,现在来讨论它的一些高级的用法. 1.CommaT ...

  2. Python中用format函数格式化字符串的用法

    这篇文章主要介绍了Python中用format函数格式化字符串的用法,格式化字符串是Python学习当中的基础知识,本文主要针对Python2.7.x版本,需要的朋友可以参考下   自python2. ...

  3. OC字符串常用函数

    创建一个字符串对象: NSstring * str1 = @"hello"; NSString * str = [[NSString alloc]initWithString:@& ...

  4. OC字符串的常用方法

    网上写的关于字符串常用方法的博客很多,这里我简单做了下总结!不喜勿喷哦! 一.创建字符串 #import <Foundation/Foundation.h> //NSString //创建 ...

  5. c语言字符串转OC字符串

    // 如果把c语言字符串转OC字符串,@(C字符串) char *c = "abc"; NSLog(@"%@", @(c));

  6. shell字符串的用法

    shell字符串的用法 注意:shell4.2和shell4.1会有差别,较低版本的shell可能不支持某些功能 获取字符串长度:${#string} 获取子串: 注:(左边的第一个字符是用 0 表示 ...

  7. Mysql截取和拆分字符串函数用法

    Mysql截取和拆分字符串函数用法 截取字符串函数: SUBSTRING(commentid,9) 意思是:从第9个字符开始截取到最后.SUBSTRING的参数有三个,最后一个是截取的长度,默认是到结 ...

  8. OC字符串与C语言字符串之间的相互转换

    1.C转OC字符串 const char *cString = "This is a C string"; // 动态方法 NSString *ocString1 = [[NSSt ...

  9. OC字符串NSString

    ========================== 面向对象编程进阶和字符串 ========================== Δ一.类的设计模式—单例 [单例]程序允许过程中,有且仅有一块内存 ...

随机推荐

  1. [leetcode]Binary Tree Preorder Traversal @ Python

    原题地址:http://oj.leetcode.com/problems/binary-tree-preorder-traversal/ 题意:这题用递归比较简单.应该考察的是使用非递归实现二叉树的先 ...

  2. 解决报错"Your security system have blocked an application with expired or not yet valid certificate from running"

    方法如下: Go to Control Panel Java in the Security tab click the "Edit Site List-" button clic ...

  3. ASP.NET与ASP.NET MVC 中Cache的总结

    Cache有多种翻译,可以是高速缓冲存储器,也可以是法国的服装品牌,本文只是简单的谈谈就是ASP.NET 中Cache,做过Web应用程序的都知道,如果网站访问量比较大,系统应用程序可以将那些频繁访问 ...

  4. Java list 分页(多种方式)

    方式一:public static  void fenye(List list,int pagesize){    int totalcount=list.size();    int pagecou ...

  5. leetcode第一刷_Integer to Roman

    这道题当时不会写,是參照discuss写的. 首先要弄明确罗马数字的规则,这个在国外难道是常识吗.为什么题干一点都没讲.. 4000以下一共同拥有以下几种符号:"M", " ...

  6. spring_restful_json_jdbc

    使用Spring MVC +JDBC 实现输出Json数据和视图两种形式 最后面有源代码 从web.xml開始配置: 声明定义两个Servlet各自是输出视图和json <!-- 声明一个Ser ...

  7. Python面向对象编程 - 一个记事本程序范例(一)

    notebook.py import datetime last_id = 0 class Note: '''Represent a note in the notebook. Match again ...

  8. WebStorm配置

    一.主题配色 主题设置方法:File -> Settings -> Appearance & Behavior -> Appearance ->Theme. webst ...

  9. element-ui 源码架构

    1.项目结构 2.src下的入口文件 https://github.com/ElemeFE/element/blob/dev/src/index.js 入口文件实现的功能为: (1)国际化配置 (2) ...

  10. 〖Linux〗Ubuntu13.10 安装qt开发环境

    sudo apt-get install qtcreator libqt4-dev libqt4-dbg libqt4-gui libqt4-sql qt4-dev-tools qt4-doc qt4 ...