掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
文字列の分割して改行 (ID:151060)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
>InsertEnterAfterThirdComma >' 最初の3つの要素を連結します。 3番目で改行する問題をコピペして5に変えちゃったんですかね。 中途半端な改変は、PG作成者の意図が読めなくなるからやめて欲しいです。 まぁ、切り出す位置を変えるだけなら算数の範囲だし、問題を言葉で整理する 国語ができれば小学6年生くらいで解決できる知識レベルと思われます。 自分で考える力を育てないと。 Function InsertEnterAfterInsertcountComma(ByVal input As String, ByVal Insertcount As Integer) As String Dim inputReturn As String = String.Empty Dim loopIndex As Integer = 0 Dim parts As String() = input.Split(New Char() {","c}) If Insertcount < 0 Then Throw New Exception("Error:OutOfRangeIndex(Insertcount)") If Insertcount = 0 Then Return input While True loopIndex = loopIndex + Insertcount If parts.Length > loopIndex Then Dim f As String = String.Join(",", parts, loopIndex - Insertcount, Insertcount) inputReturn = inputReturn & f & "," & Environment.NewLine Else Dim t As String = String.Join(",", parts, loopIndex - Insertcount, parts.Length - (loopIndex - Insertcount)) inputReturn = inputReturn & t Exit While End If End While Return inputReturn End Function
←解決時は質問者本人がここをチェックしてください。
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.