سؤال

I've started learning Python and I was wondering if there is a way to do the opposite of trim() in Python. For example I have string: "Need some help around here" and I want it to become " Need some help around here "?

هل كانت مفيدة؟

المحلول

No, strip() removes all the space in the head and tail. But you can

' %s ' % 'Need some help around here'
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top