Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b93de72

Browse files
committed
getFieldNum
1 parent 46850f7 commit b93de72

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pyfile/file_read.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ def readFile(s):
1111

1212
def getFieldNum(line):
1313
import re
14-
matches = re.finditer(r'\S+', line)
14+
matches = re.findall(r'\S+', line)
1515
# 打印 a 字符出现的次数
16-
print(matches)
16+
print(matches.__len__())
1717

1818

1919
if __name__ == "__main__":

0 commit comments

Comments
 (0)