가능한 중복 :
Regular expression, split string by capital letter but ignore TLAC# 문자열 질문
안녕하십니까, C#에서 난 내가 분할하는 방법을 대문자 편지 를 포함하는 문장 인 문자열이있는 경우 말? 예를 들어
:
string a = "HelloWorld"
와 내가 필요
b[0] = "Hello";
b[1]= "world";
가능한 중복 :
Regular expression, split string by capital letter but ignore TLAC# 문자열 질문
안녕하십니까, C#에서 난 내가 분할하는 방법을 대문자 편지 를 포함하는 문장 인 문자열이있는 경우 말? 예를 들어
:
string a = "HelloWorld"
와 내가 필요
b[0] = "Hello";
b[1]= "world";
시도 :
String preString = "HelloWorld";
StringBuilder sb = new StringBuilder();
foreach (char c in preString)
{
if (Char.IsUpper(C))
sb.Append(' ');
sb.Append(C);
}
string result = sb.ToString();
그런 다음 Split을 사용하여 배열로 가져오고 싶습니까? – devrooms
예, 단지 공백으로 나눕니다. –
@nofortee 추가 한 첫 번째 공간을 제거하고 반복 변수를 소문자로 바꿉니다. –
참조 http://stackoverflow.com/questions/1097901/regular-expression-split -string-by-capital-letter-but-ignore-tla – Zaki
"세계"또는 "세계"? "world"이면 str.ToLower()를 사용하십시오. –
안녕하세요, 친구들, 왜 질문을 마감하셨습니까? 이것들은 같은 질문이 아닙니다. –