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

PHP-তে স্ট্রিংয়ের প্রথম ক্যারেক্টার সরানো


PHP-তে স্ট্রিংয়ের প্রথম ক্যারেক্টার সরানোর কোড নিচে দেওয়া হলো:

উদাহরণ

<?php    $str = "Test";    echo "Before removing the first character = ".$str;    $res = substr($str, 1);    echo "\nAfter removing the first character = ".$res; ?>

আউটপুট

এটি নিচের আউটপুটটি দেবে:

Before removing the first character = Test After removing the first character = est

উদাহরণ

আরেকটি উদাহরণ দেখা যাক:

<?php    $str = "Demo";    echo "Before removing the first character = ".$str;    $res = ltrim($str, 'D');    echo "\nAfter removing the first character = ".$res; ?>

আউটপুট

এটি নিচের আউটপুটটি দেবে:

Before removing the first character = Demo After removing the first character = emo

  1. পাইথনে স্ট্রিং থেকে প্রথম n ক্যারেক্টার রিমুভ করা

  2. JavaScript-এ স্ট্রিংয়ের লাস্ট ক্যারেক্টার রিমভ করার পদ্ধতি

  3. জাভাস্ক্রিপ্টে স্ট্রিং-এ একটি ক্যারেক্টারের ঘটনার সংখ্যা গণনার পদ্ধতি

  4. জাভাস্ক্রিপ্টে লিংক (এঙ্কর টেক্সট) এর প্রথম ক্যারেক্টার মুছে ফেলা