09-12-13, 08:59 PM
(09-12-13, 01:32 PM)Aly El-Haddad كتب :السلام عليكم، كتبت لك تلك الدالة:
و طريقة استخدامها:PHP كود :
Public Function Partition(ByVal str As String, ByVal cap As Integer) As List(Of String)
If str.Length < cap Then
Return New List(Of String)({str})
End If
Dim out As New List(Of String)
Do
Dim p As String = str.Substring(0, cap)
str = str.Substring(cap)
out.Add(p)
If str.Length < cap Then
p = str
out.Add(p)
Exit Do
End If
Loop
Return out
End Function
حيث 5 هو عدد الحروف في كل جزءPHP كود :
Dim parts As List(Of String) = Partition("النص الذي تريد تقسيمه", 5)
الف شكر لك اخى هذا ما اريده
