How to split string into only two parts with a given character in Ruby?

前端 未结 4 1787
生来不讨喜
生来不讨喜 2020-12-29 19:42

Our application is mining names from people using Twitter to login.

Twitter is providing full names in a single string.

Examples

1. \"Froeder         


        
4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-29 20:02

    Alternative:

        first= s.match(" ").pre_match
        rest = s.match(" ").post_match
    

提交回复
热议问题