如何提取给定字符串中“”内的所有字符串? (Objective-C)

How to extract all string inside the "" in a given string ? (Objective-C)

给出这样的字符串

This is a string - ["Testing", [["Test" , 0]] , [["TTest2",0,[23]]]

如何将双引号 "" 中的所有字符串提取到 Testing、Test、TTest2 之类的数组中?

您必须遍历外部数组,并针对每个元素检查:

  • 如果是字符串,将其添加到数组中。
  • 如果它是一个数组,那么进入它并重复相同的过程
  • 如果是任何其他类型,请继续。

这可以(应该)递归完成。