سلام بر تمامی برنامه نویسان سی شارپ 😉 در این پست کد تشخیص وجود کلمه ای که دارای یک حرف بین 2 حرف الفبا داشته باشد در سی شارپ را آماده کردم. انشاالله که این کد براتون مفید باشه.
خروجی کد به این صورت می باشد :
Matching words that contain any letters in the range 'b' through 'd'
using the following regular expression: \S*[b-d]\S*
knock
using the following regular expression: \S*[b-d]\S*
knock
کد تشخیص وجود کلمه ای که دارای یک حرف بین 2 حرف الفبا داشته باشد در سی شارپ :
using System;
using System.Text.RegularExpressions;
class MainClass {
private static void DisplayMatches(string text,string regularExpressionString) {
Console.WriteLine("using the following regular expression: " +regularExpressionString);
MatchCollection myMatchCollection = Regex.Matches(text, regularExpressionString);
foreach (Match myMatch in myMatchCollection) {
Console.WriteLine(myMatch);
using System.Text.RegularExpressions;
class MainClass {
private static void DisplayMatches(string text,string regularExpressionString) {
Console.WriteLine("using the following regular expression: " +regularExpressionString);
MatchCollection myMatchCollection = Regex.Matches(text, regularExpressionString);
foreach (Match myMatch in myMatchCollection) {
Console.WriteLine(myMatch);