【发布时间】:2017-10-06 18:23:47
【问题描述】:
在 python 中,我可以轻松地查看re 模块的所有方法:
>>> import re
>>> dir(re)
['DEBUG', 'DOTALL', 'I', 'IGNORECASE', 'L', 'LOCALE', 'M', 'MULTILINE', 'S', 'Scanner', 'T', 'TEMPLATE', 'U', 'UNICODE', 'VERBOSE', 'X', '_MAXCACHE', '__all__', '__builtins__', '__doc__', '__file__', '__name__', '__package__', '__version__', '_alphanum', '_cache', '_cache_repl', '_compile', '_compile_repl', '_expand', '_locale', '_pattern_type', '_pickle', '_subx', 'compile', 'copy_reg', 'error', 'escape', 'findall', 'finditer', 'match', 'purge', 'search', 'split', 'sre_compile', 'sre_parse', 'sub', 'subn', 'sys', 'template']
我可以对给定类的任何实例做同样的事情。 C# 可以做到这一点吗?
【问题讨论】:
-
如果您只想在编程时执行此操作,请键入“re”。 -- intellisense 会在点后弹出成员列表。