\hypertarget{interfacedc__string_1_1split}{}\section{dc\+\_\+string\+:\+:split Interface Reference}
\label{interfacedc__string_1_1split}\index{dc\+\_\+string\+::split@{dc\+\_\+string\+::split}}
\subsection*{Private Member Functions}
\begin{DoxyCompactItemize}
\item 
subroutine \hyperlink{interfacedc__string_1_1split_aa8f4151b729ca47dc42028625ea21d0e}{split\+\_\+cc} (str, carray, sep, limit)
\end{DoxyCompactItemize}


\subsection{Detailed Description}


Definition at line 118 of file dc\+\_\+string.\+f90.



\subsection{Member Function/\+Subroutine Documentation}
\mbox{\Hypertarget{interfacedc__string_1_1split_aa8f4151b729ca47dc42028625ea21d0e}\label{interfacedc__string_1_1split_aa8f4151b729ca47dc42028625ea21d0e}} 
\index{dc\+\_\+string\+::split@{dc\+\_\+string\+::split}!split\+\_\+cc@{split\+\_\+cc}}
\index{split\+\_\+cc@{split\+\_\+cc}!dc\+\_\+string\+::split@{dc\+\_\+string\+::split}}
\subsubsection{\texorpdfstring{split\+\_\+cc()}{split\_cc()}}
{\footnotesize\ttfamily subroutine dc\+\_\+string\+::split\+::split\+\_\+cc (\begin{DoxyParamCaption}\item[{character($\ast$), intent(in)}]{str,  }\item[{character($\ast$), dimension(\+:), pointer}]{carray,  }\item[{character($\ast$), intent(in)}]{sep,  }\item[{integer, intent(in), optional}]{limit }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Definition at line 1143 of file dc\+\_\+string.\+f90.


\begin{DoxyCode}
1143     \textcolor{comment}{!}
1144     \textcolor{comment}{! *str* で与えられた文字列を 文字列 *sep* で分解し,}
1145     \textcolor{comment}{! ポインタ配列 *carray* に返します.}
1146     \textcolor{comment}{! *carray* は必ず空状態にして与えてください. 割り付け状態の}
1147     \textcolor{comment}{! 場合にはエラーを返します.}
1148     \textcolor{comment}{!}
1149     \textcolor{comment}{! *limit* に正の数を与えた場合, 最大 *limit* 個のフィールドに分割}
1150     \textcolor{comment}{! します.  負の数や 0 の場合は省略した場合と同じになります.  *str*}
1151     \textcolor{comment}{! の末尾の空白は除去されます.  *sep* に空文字を代入する場合, 空白}
1152     \textcolor{comment}{! 文字で分割されます.}
1153     \textcolor{comment}{!}
1154     \textcolor{keywordtype}{use }\hyperlink{namespacedc__types}{dc\_types}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__types_adb76910ff05e3b9fe3436567f8f8dac6}{string}
1155     \textcolor{keywordtype}{implicit none}
1156     \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{intent(in)}:: str
1157     \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{pointer}:: carray(:) \textcolor{comment}{!(out)}
1158     \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{intent(in)}:: sep
1159     \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: \hyperlink{interfacegtdata__generic_1_1limit}{limit}
1160     \textcolor{keywordtype}{integer} :: num, cur, i, limitnum
1161     \textcolor{keywordtype}{character(STRING)} :: substr
1162     \textcolor{keywordtype}{logical} :: end\_flag
1163   \textcolor{keywordflow}{continue}
1164     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(\hyperlink{interfacegtdata__generic_1_1limit}{limit})) \textcolor{keywordflow}{then}
1165       \textcolor{keywordflow}{if} (\hyperlink{interfacegtdata__generic_1_1limit}{limit} > 0) \textcolor{keywordflow}{then}
1166         limitnum = \hyperlink{interfacegtdata__generic_1_1limit}{limit}
1167       \textcolor{keywordflow}{else}
1168         limitnum = 0
1169 \textcolor{keywordflow}{      end if}
1170     \textcolor{keywordflow}{else}
1171       limitnum = 0
1172 \textcolor{keywordflow}{    end if}
1173 
1174     \textcolor{keywordflow}{if} (len(trim(sep)) == 0) \textcolor{keywordflow}{then}
1175       num = 1
1176       substr = str
1177       \textcolor{comment}{! 重複して無駄だが carray を allocate するため, 何分割するか}
1178       \textcolor{comment}{! 調べ, num に格納する.}
1179       \textcolor{keywordflow}{do}
1180         cur = index(trim(substr), \textcolor{stringliteral}{' '})
1181         \textcolor{keywordflow}{if} (cur == 0) \textcolor{keywordflow}{exit}
1182         num = num + 1
1183         substr = adjustl(substr(cur + len(sep) :len(substr)))
1184 \textcolor{keywordflow}{      end do}
1185 
1186       \textcolor{keywordflow}{if} (limitnum /= 0 .and. num > limitnum) num = limitnum
1187       \textcolor{keyword}{allocate}(carray(num))
1188 
1189       substr = str
1190 \textcolor{keyword}{      end}\_flag = .false.
1191       \textcolor{keywordflow}{do} i = 1, num
1192         cur = index(trim(substr), \textcolor{stringliteral}{' '})
1193         \textcolor{keywordflow}{if} (cur == 0 .or. i == num) end\_flag = .true.
1194         \textcolor{keywordflow}{if} (end\_flag) \textcolor{keywordflow}{then}
1195           carray(i) = substr
1196           \textcolor{keywordflow}{exit}
1197         \textcolor{keywordflow}{else}
1198           carray(i) = substr(1:cur - 1)
1199 \textcolor{keywordflow}{        end if}
1200         substr = adjustl(substr(cur + len(sep) :len(substr)))
1201 \textcolor{keywordflow}{      end do}
1202 
1203     \textcolor{keywordflow}{else}
1204       num = 1
1205       substr = str
1206       \textcolor{comment}{! 重複して無駄だが carray を allocate するため, 何分割するか}
1207       \textcolor{comment}{! 調べ, num に格納する.}
1208       \textcolor{keywordflow}{do}
1209         cur = index(substr, trim(sep))
1210         \textcolor{keywordflow}{if} (cur == 0) \textcolor{keywordflow}{exit}
1211         num = num + 1
1212         substr = substr(cur + len(sep) :len(substr))
1213 \textcolor{keywordflow}{      end do}
1214 
1215       \textcolor{keywordflow}{if} (limitnum /= 0 .and. num > limitnum) num = limitnum
1216       \textcolor{keyword}{allocate}(carray(num))
1217 
1218       substr = str
1219 \textcolor{keyword}{      end}\_flag = .false.
1220       \textcolor{keywordflow}{do} i = 1, num
1221         cur = index(substr, trim(sep))
1222         \textcolor{keywordflow}{if} (cur == 0 .or. i == num) end\_flag = .true.
1223         \textcolor{keywordflow}{if} (end\_flag) \textcolor{keywordflow}{then}
1224           carray(i) = substr
1225           \textcolor{keywordflow}{exit}
1226         \textcolor{keywordflow}{else}
1227           carray(i) = substr(1:cur - 1)
1228 \textcolor{keywordflow}{        end if}
1229         substr = substr(cur + len(sep) :len(substr))
1230 \textcolor{keywordflow}{      end do}
1231 \textcolor{keywordflow}{    end if}
1232 
1233     \textcolor{keywordflow}{return}
1234 
\end{DoxyCode}


The documentation for this interface was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
dc\+\_\+utils/\hyperlink{dc__string_8f90}{dc\+\_\+string.\+f90}\end{DoxyCompactItemize}
