Turorial1

  • dotnetライブラリを簡単に使う。うーん便利だ
>>> s = "abc"
>>> dir(s)
['__add__', '__class__', '__cmp__', '__contains__', '__doc__', '__eq__', '__geti
tem__', '__getnewargs__', '__getslice__', '__init__', '__len__', '__mod__', '__m
odule__', '__mul__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr
__', '__rmul__', '__str__', 'capitalize', 'center', 'count', 'decode', 'encode',
 'endswith', 'expandtabs', 'find', 'index', 'isalnum', 'isalpha', 'isdecimal', '
isdigit', 'islower', 'isnumeric', 'isspace', 'istitle', 'isunicode', 'isupper',
'join', 'ljust', 'lower', 'lstrip', 'replace', 'rfind', 'rindex', 'rjust', 'rspl
it', 'rstrip', 'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title'
, 'translate', 'upper', 'zfill']
>>> import System
>>> dir(s)
['Add', 'Capitalize', 'Center', 'Clone', 'Compare', 'CompareOrdinal', 'CompareTo
', 'Concat', 'Contains', 'Copy', 'CopyTo', 'Count', 'Decode', 'Empty', 'Encode',
 'EndsWith', 'Equals', 'EqualsRetBool', 'ExpandTabs', 'Finalize', 'Find', 'Forma
t', 'GetEnumerator', 'GetHashCode', 'GetLength', 'GetNewArgs', 'GetSlice', 'GetT
ype', 'GetTypeCode', 'Index', 'IndexOf', 'IndexOfAny', 'Insert', 'Intern', 'IsAl
num', 'IsAlpha', 'IsDecimal', 'IsDigit', 'IsInterned', 'IsLower', 'IsNormalized'
, 'IsNullOrEmpty', 'IsNumeric', 'IsSpace', 'IsTitle', 'IsUnicode', 'IsUpper', 'J
oin', 'LJust', 'LStrip', 'LastIndexOf', 'LastIndexOfAny', 'Length', 'Lower', 'Ma
ke', 'MakeDynamicType', 'MemberwiseClone', 'Modulus', 'Multiply', 'Normalize', '
NotEquals', 'PadLeft', 'PadRight', 'RFind', 'RIndex', 'RJust', 'RSplit', 'RStrip
', 'Reduce', 'ReferenceEquals', 'Remove', 'Replace', 'ReverseMultiply', 'Split',
 'SplitLines', 'StartsWith', 'Strip', 'Substring', 'SwapCase', 'Title', 'ToCharA
rray', 'ToLower', 'ToLowerInvariant', 'ToString', 'ToUpper', 'ToUpperInvariant',
 'Translate', 'Trim', 'TrimEnd', 'TrimStart', 'Upper', 'ZFill', '__add__', '__cl
ass__', '__cmp__', '__contains__', '__doc__', '__eq__', '__getitem__', '__getnew
args__', '__getslice__', '__init__', '__len__', '__mod__', '__module__', '__mul_
_', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__rmul__',
'__str__', 'capitalize', 'center', 'count', 'decode', 'encode', 'endswith', 'exp
andtabs', 'find', 'index', 'isalnum', 'isalpha', 'isdecimal', 'isdigit', 'islowe
r', 'isnumeric', 'isspace', 'istitle', 'isunicode', 'isupper', 'join', 'ljust',
'lower', 'lstrip', 'replace', 'rfind', 'rindex', 'rjust', 'rsplit', 'rstrip', 's
plit', 'splitlines', 'startswith', 'strip', 'swapcase', 'title', 'translate', 'u
pper', 'zfill']
>>> s.ToUpper()
'ABC'
  • 小文字が標準の組み込みで大文字がDotnetライブラリようだね。