将1个字符串分隔为更多 [英] separate 1 string into more

查看:170
本文介绍了将1个字符串分隔为更多的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Dear All,
A有一个这样的字符串:

Dear All, A have a string like this:

a <- "Good,Good*********,Good***********,Perfect,Perfect**********,Perfect***********"

现在我想将它分成:

a <- c("Good","Good*********","Good***********","Perfect","Perfect**********","Perfect***********")

任何建议都非常欢迎!非常感谢您,

any suggestions are very welcome! Thanks you,

Lisanne

推荐答案

strsplit 执行此操作:

a<-"Good,Good***,Good****,Perfect,Perfect***,Perfect*****"
a <- strsplit(a, ",")[[1]]

这篇关于将1个字符串分隔为更多的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆