# -*- coding: iso-8859-1 -*- #. // _by_left.py #. // Renvoie la partie gauche demandée dans la chaîne. def by_left( cStringe, nChars ): return cStringe[ : nChars ] ''' Dernière modification : 2022-02-02 Harbour : left() dBasePlus : left() VBScript : Left() [Exemple] import sys sys.path.append( "modules" ) from _by_left import by_left s = "1234567890ABCDEF" # // 16 caractères. print( "by_left( " + s + ", 0 ) = " + by_left( s, 0 ) ) # '' print( "by_left( " + s + ", 1 ) = " + by_left( s, 1 ) ) # '1' print( "by_left( " + s + ", 2 ) = " + by_left( s, 2 ) ) # '12' print( "by_left( " + s + ", 16 ) = " + by_left( s, 16 ) ) # '1234567890ABCDEF' print( "by_left( " + s + ", 17 ) = " + by_left( s, 17 ) ) # '1234567890ABCDEF' [/Exemple] '''