Reverse পদ্ধতি ব্যবহার করে একটি অ্যারেতে উপাদানগুলো উল্টো করুন।
নিচে আমাদের ক্যারেক্টার অ্যারেটি দেওয়া হলো।
char[] ch = { 't', 'i', 'm', 'e' };এখন AsQueryable() পদ্ধতির সাথে Reverse() পদ্ধতি ব্যবহার করে উল্টো ফলাফল পান।
ch.AsQueryable().Reverse();
সম্পূর্ণ কোড নিচে দেখুন।
উদাহরণ
using System; using System.Linq; using System.Collections.Generic; public class Demo { public static void Main() { char[] ch = { 't', 'i', 'm', 'e' }; Console.Write("String = "); foreach(char arr in ch) { Console.Write(arr); } IQueryable<char> res = ch.AsQueryable().Reverse(); Console.Write("\nReversed String = "); foreach (char c in res) { Console.Write(c); } } }আউটপুট
String = time Reversed String = emit