NSCharacterSet-追加另一个字符集 [英] NSCharacterSet - append another character set

查看:250
本文介绍了NSCharacterSet-追加另一个字符集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个字符集,其中包括它自己的所有字符以及其他字符集中的字符。换句话说。

I would like to create a character set that includes all of its own characters, as well as those from another character set. Append in other words.

我本来以为有一种明显的方法,但是在IDE中完成控制空间,然后仔细研究文档之后,我什么也做不了。

I thought there'd be an obvious way, but after control-space completion in the IDE, and then poking around the docs, I couldn't fine anything.

我可以看到如何附加字符串中的所有字符。但是我需要附加另一组字符。如果有to-string方法,我想我可以对第二组进行字符串化。

I can see how to append all the characters from a string. But I need to append the characters from another set. I guess I could to-string the second set, if there's a to-string method.

我该怎么做?

推荐答案

您可能正在 NSMutableCharacterSet 中寻找该方法:

You are probably seaching for this method in NSMutableCharacterSet :

- (void)formUnionWithCharacterSet:(NSCharacterSet *)otherSet

从Doc:


修改接收者,使其包含$ b中存在的所有字符$ b是接收者或otherSet。

Modifies the receiver so it contains all characters that exist in either the receiver or otherSet.

这篇关于NSCharacterSet-追加另一个字符集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆