سلام بر تمامی برنامه نویسان سی شارپ 😉 در این مطلب کد Regex:اعتبارسنجی شماره تلفن در سی شارپ #C را آماده کردم. انشاالله که این کد سی شارپ براتون مفید باشد.
کد Regex:اعتبارسنجی شماره تلفن در سی شارپ #C :
using System;
using System.Text.RegularExpressions;
class RegExp
{
public static void Main()
{
String[] phone_nos = {"111-123-4567","1111-1234-4567"};
String phone_regexp = "[0-9]{3}-[0-9]{3}-[0-9]{4}";
foreach (String phone in phone_nos)
{
Match m = Regex.Match(phone,phone_regexp);
if (m.Success)
using System.Text.RegularExpressions;
class RegExp
{
public static void Main()
{
String[] phone_nos = {"111-123-4567","1111-1234-4567"};
String phone_regexp = "[0-9]{3}-[0-9]{3}-[0-9]{4}";
foreach (String phone in phone_nos)
{
Match m = Regex.Match(phone,phone_regexp);
if (m.Success)