প্রথমে স্ট্রিং সেট করুন:
string str = "Football and Tennis";
এখন Substring() মেথড ব্যবহার করে শেষ ৪টি ক্যারেক্টার বের করুন:
str.Substring(str.Length - 4);
সম্পূর্ণ কোড
using System;
public class Demo
{
public static void Main()
{
string str = "Football and Tennis";
string res = str.Substring(str.Length - 4);
Console.WriteLine(res);
}
}
আউটপুট
nnis