开发者

How to parse a string for an integer matrix in Objective C

开发者 https://www.devze.com 2023-01-25 07:13 出处:网络
Can someone help me extracting a 2D matrix of integers from a string like the one below in Objective C?

Can someone help me extracting a 2D matrix of integers from a string like the one below in Objective C?

1 1 0 0 -1

-1 0 1 1 0

0 -1 0 开发者_运维百科1 0

0 0 -1 -1 1


The easiest way is probably to use an NSScanner object. See the Strings Programming Guide for further info.

0

精彩评论

暂无评论...
验证码 换一张
取 消