Solved! Go to Solution.
before your code (I reversed them here). I understand you can also do it interactively with the # sign such thing, but I'm a little old school... have it your way and enjoy!
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