def FindLabel ([ANAME]): text = [ANAME] S = text.split(', ') if len(S) == 1: S2 = S[0].split(' ', 1) S2 = S2[0] + '\n' + S2[1] else: S2 = S[0] + ',\n' ABBREV = '' S3 = S[1].split(' ') for each in S3: if not each in ('&', 'AND'): ABBREV = ABBREV + each[0:1] + '. ' else: ABBREV = ABBREV + each[0:1] + ' ' S2 = S2 + ABBREV[0:-1] return S2
def FindLabel ( [ANAME], [ACRE_FLT] ): if float ( [ACRE_FLT] ) >=41: S = [ANAME] if ', ' in S: S = S.replace ( ', ', ',\n' ) elif ' ' in S: S = S.replace (' ', ',\n') else: # do something else if another test is necessary, but for now simply pass pass return S
def FindLabel ( [ANAME], [ACRE_FLT] ): if float ( [ACRE_FLT] ) >=41: S = [ANAME] S = S.split(',') S = S[0] + ',\n' + S[1] return S
def FindLabel ( [ANAME], [ACRE_FLT] ): if float ( [ACRE_FLT] ) >=41: S = [ANAME] S = S.split(',') return S
string = 'value1,value2' #string.split(',')[0] will return 'value1' #string.split(',')[1] will return 'value2'
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.