我有一个字符串,想要将它分成两个部分。第一部分是逗号(
我已经成功将第一个逗号前的部分存入变量
,
)之前的内容,第二部分则包括逗号后面所有的内容(包括逗号)。我已经成功将第一个逗号前的部分存入变量
$Header
中,但不知道如何将其后面的部分作为一个整体存入新的字符串中。$string = "Header text,Text 1,Text 2,Text 3,Text 4,"
$header = $string.Split(',')[0] # $Header = "Header text"
$content = "Text 1,Text 2,Text 3,Text 4,"
# There might be more text then visible here, like say Text 5, Text 6, ..