স্ট্রিং সেট করুন -
string str = "Cookie and Session";
স্ট্রিং −
থেকে শেষ 2টি অক্ষর পেতে নিম্নলিখিত Regex ব্যবহার করুনRegex.Match(str,@"(.{2})\s*$") নিচের কোড −
উদাহরণ
using System;
using System.Text.RegularExpressions;
public class Demo {
public static void Main() {
string str = "Cookie and Session";
Console.WriteLine(Regex.Match(str,@"(.{2})\s*$"));
}
} আউটপুট
on