سلام بر تمامی برنامه نویسان سی شارپ 😉 در این مطلب آموزش چک کردن شروع شدن و تمام شدن رشته با متنی خاص با StartsWith و EndsWith در c#.net را آماده کردم. انشاالله که این آموزش برای شما مفید باشد.
خروجی کد به این صورت می باشد :
str begins with "abc"
str ends with "ijk."
str ends with "ijk."
کد چک کردن شروع شدن و تمام شدن رشته با متنی خاص با StartsWith و EndsWith در c#.net :
using System;
class MainClass {
public static void Main() {
string str = "abcdefghijk";
if(str.StartsWith("abc"))
Console.WriteLine("str begins with "abc"");
class MainClass {
public static void Main() {
string str = "abcdefghijk";
if(str.StartsWith("abc"))
Console.WriteLine("str begins with "abc"");