substring matching

M

M.N.A.Smadi

hi;

say i have the following variable

data="""XYZ dflsjdfkl sdfsdhfl
jdsflkdsjf
sldjfsldjf
"""

i need to make sure that the first part is actually XYZ, is there an
easy way of doing that?

thanks
m.smadi
 
R

Roel Schroeven

M.N.A.Smadi said:
hi;

say i have the following variable

data="""XYZ dflsjdfkl sdfsdhfl
jdsflkdsjf
sldjfsldjf
"""

i need to make sure that the first part is actually XYZ, is there an
easy way of doing that?

data.startswith("XYZ")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,222
Messages
2,571,137
Members
47,754
Latest member
Armand37T7

Latest Threads

Top