#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. 基于zabbix 的memached 多实例监控

    基于zabbix 的memached 多实例监控 zabbix agentd 配置文件新增配置: UserParameter=memcached.server.discovery[*],ps uax ...

  2. Android动画-帧动画

    Android 平台提供了两种动画一种是 Frame动画,即顺序的播放事先做好的图像,与gif图片或者说跟放电影的原理相似,另一种是Tween动画,就是对场景里的对象不断的进行图像变化来产生动画效果( ...

  3. Merge Sorted Array leetcode java(回顾MergeTwoArray和MergeTwoLinkedList)

    题目: Given two sorted integer arrays A and B, merge B into A as one sorted array. Note: You may assum ...

  4. Managed Debugging Assistant 'PInvokeStackImbalance' has detected a problem in 解决方案

    because regular C functions work differently than the Windows API functions; their "calling con ...

  5. 解决bootstrap和jquey中的.button扩展冲突的问题。

     

  6. List 去重对象

    @Overridepublic RpcResponse<List<HobbiesVo>> queryHobbies(Long userId) { try{ List<Ho ...

  7. JavaScript 之 对象和数组

    一:对象   说起对象,我们不自然就想起了面向对象中自封装的一个类,同样JS中也是遵循这个守则,在web编程中几乎天天用到的就是JSON.是的,这就是一个对象,不过这个对象下面的字段都是字符串和值类型 ...

  8. php 内置函数JSON处理

    一:生成json数据 <?php $arr = array ('a'=>1,'b'=>2,'c'=>3,'d'=>4,'e'=>5); echo json_enco ...

  9. CentOS(学习笔记一)

    菜鸟记录 一.配置网络.防火墙等 setup命令 二.查看网络 ifconfig 重启网络 /ect/init.d/network restart 或者ifup ethx(,,)等 查看网络配置文件 ...

  10. 腾讯地图api将物理地址转化成坐标

    <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content ...