【问题标题】:How to find common pattern of two NSStrings?如何找到两个 NSStrings 的共同模式?
【发布时间】:2010-11-12 04:18:56
【问题描述】:

例如:

NSString *file1 = @"Invoice1";
NSString *file2 = @"Invoice2";

如何找到上述NSStrings的共同模式(即@"Invoice")?

【问题讨论】:

    标签: objective-c cocoa-touch ios nsstring


    【解决方案1】:

    参见NSString-commonPrefixWithString:options: 方法。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-08-12
      相关资源
      最近更新 更多