Программисты JAVA общаются здесь
1710223287
Гость
У меня есть многострочная строка, разделенная набором различных разделителей: [code](Text1)(DelimiterA)(Text2)(DelimiterC)(Text3)(DelimiterB)(Text4) [/code] I can split this string into its parts, using [code]String.split[/code], but it seems that I can't get the actual string, which matched the delimiter regex. In other words, this is what I get: [list] [*][code]Text1[/code] [*][code]Text2[/code] [*][code]Text3[/code] [*][code]Text4[/code] [/list] This is what I want [list] [*][code]Text1[/code] [*][code]DelimiterA[/code] [*][code]Text2[/code] [*][code]DelimiterC[/code] [*][code]Text3[/code] [*][code]DelimiterB[/code] [*][code]Text4[/code] [/list] Is there any JDK way to split the string using a delimiter regex but also keep the delimiters? Источник: [url]https://stackoverflow.com/questions/2206378/how-to-split-a-string-but-also-keep-the-delimiters[/url]
0 Ответы
42 Просмотры
Последнее сообщение Гость
11 мар 2024, 14:33
0 Ответы
11 Просмотры
Последнее сообщение Anonymous
27 ноя 2024, 20:18
0 Ответы
2 Просмотры
Последнее сообщение Anonymous
27 авг 2025, 03:07
0 Ответы
110 Просмотры
Последнее сообщение Anonymous
25 июн 2024, 19:12
0 Ответы
53 Просмотры
Последнее сообщение Anonymous
10 май 2024, 04:51