xiongshizhao
xiongshizhao

Reputation: 21

How to use str_sub?

When I use str_sub to get the first 3, I get the result like this,

enter image description here

Actually, I want to get the first 3 digits,

enter image description here

like, 216-555-2549, I want to have 216, things like that. How can I get it?

Upvotes: 0

Views: 71

Answers (1)

jolii
jolii

Reputation: 97

your argument for string = does not need a "" try to change string= "phone_number" to string = phone_number

Upvotes: 3

Related Questions