How to check if NSString begins with a certain character

How do you check if an NSString begins with a certain character (the character *).

The * is an indicator for the type of the cell, so I need the contents of this NSString without the *, but need to know if the * exists.

You can use the -hasPrefix: method of NSString:

NSString* output = nil;
if([string hasPrefix:@"*"])
output = [string substringFromIndex:];

How to check if NSString begins with a certain character的更多相关文章

  1. An Implementation of Double-Array Trie

    Contents What is Trie? What Does It Take to Implement a Trie? Tripple-Array Trie Double-Array Trie S ...

  2. java.lang.Long 类源码解读

    总体阅读了Long的源码,基本跟Integer类类似,所以特别全部贴出源码,直接注释进行理解. // final修饰符 public final class Long extends Number i ...

  3. 谷歌的java文本差异对比工具

    package com.huawei.common.transfertool.utils; /** * @author Paul * @version 0.1 * @date 2018/12/11 * ...

  4. 双数组Trie的一种实现

    An Implementation of Double-Array Trie 双数组Trie的一种实现 原文:http://linux.thai.net/~thep/datrie/datrie.htm ...

  5. 沉淀再出发:java中的equals()辨析

    沉淀再出发:java中的equals()辨析 一.前言 关于java中的equals,我们可能非常奇怪,在Object中定义了这个函数,其他的很多类中都重载了它,导致了我们对于辨析其中的内涵有了混淆, ...

  6. 【原创】Google的文本内容对比代码

    /* * Diff Match and Patch * * Copyright 2006 Google Inc. * http://code.google.com/p/google-diff-matc ...

  7. bash5.0参考手册

    Bash Reference Manual a.summary-letter { text-decoration: none } blockquote.indentedblock { margin-r ...

  8. jquery1.7.2的源码分析(一)

    说到jquery可能是大家最经常用到的,在日常的编写程序中最经常使用到,在使用jquery插件的同时,深入的解读jquery源码有利于我们学到设计的思想和实现的技巧 在jquery源码的分析中,其中艾 ...

  9. jQuery静态方法globalEval使用和源码分析

    Eval函数大家都很熟悉,但是globalEval方法却很少使用,大多数参考手册也没有相关api,下面就对其用法和源码相应介绍: jQuery.globalEval()函数用于全局性地执行一段Java ...

随机推荐

  1. shell脚本中的特殊符号

    1.{} 大括号:用法一:通配符扩展eg: ls my_{finger,toe}s这条命令相当于如下命令的组合:ls my_fingers my_toeseg: mkdir {userA,userB, ...

  2. php5.3 连接 sqlserver2005

    操作系统:XP php5.3以后,已经不对sqlserver支持连接扩展了,不过微软官方还是对php5.3以后进行了扩展解决方案. 1.确认要连接sqlserver的数据库版本为2005 2.确认ph ...

  3. 语音分享应用ios源码

    该源码是语音分享应用源码,本demo使用了科大讯飞语音识别作为分享内容的输入方式,同时也支持手动键盘输入分享内容,限制分享内容文字不能超过180个字符,分享内容输入完成后可以直接分享,分享SDK使用的 ...

  4. Ubuntu16.04+hadoop2.7.3环境搭建

    转载请注明源出处:http://www.cnblogs.com/lighten/p/6106891.html 最近开始学习大数据相关的知识,最著名的就是开源的hadoop平台了.这里记录一下目前最新版 ...

  5. 如何防止DDos攻击?

    ---恢复内容开始--- 一.拒绝服务攻击的发展 从拒绝服务攻击诞生到现在已经有了很多的发展,从最初的简单Dos到现在的DDOS.那么什么是Dos和DDOS呢?DoS是一种利用单台计算机的攻击方式.而 ...

  6. c++对象模型以及内存布局的研究

    先引出问题,看一段代码: #include <iostream> using namespace std; class A { }; class B { public: B() {} ~B ...

  7. Dynamic Prompt Table for Record Field on PeopleSoft Page

    Sometimes a situation in project work arises to have a dynamic prompt table for record fields on Peo ...

  8. c#中操作word文档-三、MSDN文档

    这是关于word读写的MSDN内容,基本所有的方法都可以在这上面找到 https://msdn.microsoft.com/zh-cn/library/office/ff837519.aspx

  9. windows实用技巧

    电脑如今已经非常普及,不过目前大多数电脑系统都是Win7/Win8.1或者Win10.你真的对自己电脑系统了解吗?今天小编为大家分享13个实用电脑技巧,会这些电脑技巧才叫牛哦! 13个实用电脑技巧 一 ...

  10. JSON.stringify 语法实例讲解

    语法:  JSON.stringify(value [, replacer] [, space]) value:是必选字段.就是你输入的对象,比如数组,类等. replacer:这个是可选的.它又分为 ...