How to split name in label so only first two words appear?

المشرف العام

Administrator
طاقم الإدارة
The labels for my feature SSA_NAME are approximately 5 words long. I would like to shorten the labels to only 2 words. Every time I try a different code I receive either an error message or my layer is not labelled at all. Here is a code I tried based on another person's StackExchange question.

def convertLabel([SSA_NAME]): S= [SSA_NAME] S = S.split(" ")1 return S





أكثر...
 
أعلى