■
■ 事例
↑ TOP
$ jython Jython 2.5.0 (Release_2_5_0:6476, Jun 16 2009, 13:33:26) [Java HotSpot(TM) Client VM (Apple Inc.)] on java1.5.0_13 Type "help", "copyright", "credits" or "license" for more information. >>> # ---------------------------------------- StringBuilder>>> >>> # ---------------------------------------- charAt >>> sb = StringBuilder("ABC"); sb ABC >>> for i in range(sb.length()): ... print("%d: %s"%(i, sb.charAt(i))) ... 0: A 1: B 2: C >>> # ---------------------------------------- indexOf >>> sb = StringBuilder("as happy as happy can be"); sb as happy as happy can be >>> >>> sb.indexOf('h') 3 >>> sb.indexOf("as") 0 >>> >>> sb.lastIndexOf('h') 12 >>> sb.lastIndexOf("as") 9 >>>↑ TOP
Java.use(better, Tips);
■ INDEX
>>> dir(java.lang.StringBuilder) ['__class__', '__delattr__', '__doc__', '__eq__', '__getattribute__', '__hash__', '__init__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__str__', 'append', 'appendCodePoint', 'capacity', 'charAt', 'class', 'codePointAt', 'codePointBefore', 'codePointCount', 'delete', 'deleteCharAt', 'ensureCapacity', 'equals', 'getChars', 'getClass', 'hashCode', 'indexOf', 'insert', 'lastIndexOf', 'length', 'notify', 'notifyAll', 'offsetByCodePoints', 'replace', 'reverse', 'setCharAt', 'setLength', 'subSequence', 'substring', 'toString', 'trimToSize', 'wait']
》作業中です《
↑ TOP
Created: 1998/05/23|Last updated: 2013/04/08 1:22:16