কম্পিউটার টিউটোরিয়াল

জাভাতে দেওয়া ক্যারেক্টারের ইউনিকোড ক্যাটেগরি খুঁজে বের করা


Character ক্লাস একটি Object-এর সাবক্লাস এবং এটি প্রিমিটিভ টাইপ char-এর মান একটি অবজেক্টে র‍্যাপ করে। Character টাইপের একটি অবজেক্টে একটি একক ফিল্ড থাকে যার টাইপ char। getType() মেথড ব্যবহার করে আমরা একটি নির্দিষ্ট ক্যারেক্টারের ইউনিকোড ক্যাটেগরি নির্ধারণ করতে পারি। এটি Character ক্লাসের একটি স্ট্যাটিক মেথড এবং এটি ইন্টিজার ভ্যালু ফেরত দেয় যা char ch-র ইউনিকোড জেনারেল ক্যাটেগরি উপস্থাপন করে।

সিনট্যাক্স

public static int getType(char ch)

উদাহরণ

public class CharacterTypeTest { 
    public static void main(String args[]) { 
        System.out.println("T represents unicode category of: " + Character.getType('T')); 
        System.out.println("@ represents unicode category of: " + Character.getType('@')); 
        System.out.println(") represents unicode category of: " + Character.getType(')')); 
        System.out.println("1 represents unicode category of: " + Character.getType('1')); 
        System.out.println("- represents unicode category of: " + Character.getType('-')); 
        System.out.println("_ represents unicode category of: " + Character.getType('_')); 
        System.out.println("a represents unicode category of: " + Character.getType('a')); 
    } 
}

আউটপুট

T represents unicode category of: 1 @ represents unicode category of: 24 ) represents unicode category of: 22 1 represents unicode category of: 9 - represents unicode category of: 20 _ represents unicode category of: 23 a represents unicode category of: 2 

  1. জাভাতে দেওয়া স্ট্রিং থেকে HTML ট্যাগ সরানো

  2. জাভাতে দেওয়া ক্যারেক্টার নম্বর/লেটার কিনা চেক করা

  3. জাভাতে JPasswordField-এ ইকো ক্যারেক্টার শো/হাইড করা

  4. আপনার উইন্ডোজ ১০/১১ প্রোডাক্ট কী দ্রুত ও নিরাপদে খুঁজে বের করুন