الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

معظم دوال التعامل مع string

مغلق
بدأه KARIMSOFT في 21 أكتوبر 2006 · 2 رد · 597 مشاهدة · في Microsoft Visual Basic.NET
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

معظم دول النصوص

Public Class Form1
	Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

	Public Sub New()
		MyBase.New()

		'This call is required by the Windows Form Designer.
		InitializeComponent()

		'Add any initialization after the InitializeComponent() call

	End Sub

	'Form overrides dispose to clean up the component list.
	Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
		If disposing Then
			If Not (components Is Nothing) Then
				components.Dispose()
			End If
		End If
		MyBase.Dispose(disposing)
	End Sub

	'Required by the Windows Form Designer
	Private components As System.ComponentModel.IContainer

	'NOTE: The following procedure is required by the Windows Form Designer
	'It can be modified using the Windows Form Designer.  
	'Do not modify it using the code editor.
	Friend WithEvents Button1 As System.Windows.Forms.Button
	<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
		Me.Button1 = New System.Windows.Forms.Button
		Me.SuspendLayout()
		'
		'Button1
		'
		Me.Button1.Location = New System.Drawing.Point(192, 48)
		Me.Button1.Name = "Button1"
		Me.Button1.TabIndex = 0
		Me.Button1.Text = "Button1"
		'
		'Form1
		'
		Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
		Me.ClientSize = New System.Drawing.Size(292, 273)
		Me.Controls.Add(Me.Button1)
		Me.Name = "Form1"
		Me.Text = "Form1"
		Me.ResumeLayout(False)

	End Sub

#End Region

	Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
		Dim s As String = "arabteam2000-Forum.com"
		MessageBox.Show(s.CompareTo("tabm").ToString()) 'ليس متشابهان
		MessageBox.Show(s.CompareTo("arabteam2000.com").ToString()) '==متشابهان
		MessageBox.Show(s.EndsWith(".g").ToString()) 'falseليس ينتهي هذا النص 
		MessageBox.Show(s.EndsWith(".com").ToString()) 'true ينتهي هذا النص 
		MessageBox.Show(s.Equals(".com").ToString()) 'متشابهان ام لا
		MessageBox.Show(s.GetHashCode().ToString())   'HashCode
		MessageBox.Show(s.GetType().ToString())   'get classtype of val string or int ....
		MessageBox.Show(s.GetTypeCode().ToString())	'get type of val string or int ....
		MessageBox.Show(s.IndexOf("team").ToString())   'seach ang get index frist cahr if see
		MessageBox.Show(s.Insert(4, "@").ToString())  'insert val is string
		MessageBox.Show(s.Length().ToString())   'get number of cahr
		MessageBox.Show(s.Remove(4, 2).ToString())  'عكس Insert
		MessageBox.Show(s.Replace("team", "فريق").ToString())  'تبديل جزء
		'///////////////////
		Dim a() As String = s.Split(Convert.ToChar("."))  'تقسيم النس الي مقاطع من رمز
		MessageBox.Show(a(0))  'المقصع الاول
		MessageBox.Show(a(1)) 'المقصع الثاني
		MessageBox.Show(a.Length.ToString()) ' طول المقاطع
		'////////////////////
		MessageBox.Show(s.StartsWith(".g").ToString()) 'falseليس يبدء هذا النص 
		MessageBox.Show(s.StartsWith("arab").ToString()) 'true يبدء هذا النص 
		MessageBox.Show(s.Substring(2, 5).ToString()) 'جزء من الكلمه من الي 
		MessageBox.Show(s.Substring(2).ToString()) 'جزء من الكلمه من الي النهاية 
		'///////////////////
		Dim b() As Char = s.ToCharArray() 'تقسيم النس الي مقاطع الي رموز حروف
		MessageBox.Show(b(0).ToString())  'المقصع الاول
		MessageBox.Show(b(1).ToString()) 'المقصع الثاني
		MessageBox.Show(b(2).ToString())
		MessageBox.Show(a.Length.ToString()) ' طول المقاطع
		'////////////////////
		MessageBox.Show(s.ToLower()) ' حرف صفيره 
		MessageBox.Show(s.ToUpper()) ' حرف كبيره 
		MessageBox.Show(s.ToString()) 'اذا كان sغير  نصي مثل رقم يحمول 
		MessageBox.Show(s.Trim().ToString()) ' اذا حرف في البداية والنهاية 
		MessageBox.Show(s.Trim(Convert.ToChar("a")).ToString()) ' اذا حرف في البداية والنهاية
		MessageBox.Show(s.TrimStart(Convert.ToChar("a")).ToString()) ' اذا حرف في البداية فقط
		MessageBox.Show(s.TrimEnd(Convert.ToChar("a")).ToString()) ' اذا حرف في النهاية فقط
	End Sub
End Class
#2

يعطيك العافيه اخوي صراحه سرد جميل للدوال وننتظر المزيد

#3

مشكور اخي العزيز وبانتظار المزيد

وفقك الله

هذا الموضوع مغلق.

مواضيع مشابهة