ios – Monotouch中是否存在NSString的“stringByReplacingCharactersInRange”方法?

NSString的Apple文档中有一个stringByReplacingCharactersInRange方法,但是我在Monotouch中找不到这个方法.

Monotouch是否缺少此方法实现 – 本机API绑定?

我需要这个方法在shouldChangeCharactersInRange中实现一些自定义字符串处理逻辑

解决方法

这里有一些代码可以满足您的需求:
string text = field.Text;
string result;

result = text.Substring (0,range.Location) + replacement + text.Substring (range.Location + range.Length);

相关文章

当我们远离最新的 iOS 16 更新版本时,我们听到了困扰 Apple...
欧版/美版 特别说一下,美版选错了 可能会永久丧失4G,不过只...
一般在接外包的时候, 通常第三方需要安装你的app进行测...
前言为了让更多的人永远记住12月13日,各大厂都在这一天将应...