19 - Java Program to count total number of characters in a string

Поділитися
Вставка
  • Опубліковано 8 вер 2024
  • Here is the link of Full Play List ► bit.ly/2ZGeBFC
    Here we will learn a Java Program to count total number of characters in a string.
    Additional Info
    Link for SDET/QA Interview Full Play List ► bit.ly/3frBpQZ
    Link for API Testing Full Play List ► bit.ly/2BY0vHu
    Link for Cypress Tutorial Full Play List ► bit.ly/3iMdi2a
    Link for Web-services Full Play List ► bit.ly/3bfK0Ef
    Link for Protractor Testing Full Play List ► bit.ly/2ztlEIK
    Link for Java Programs for Software Testers Full Play List ► bit.ly/2ZGeBFC
    Link for Java Tutorial Full Play List ► bit.ly/2Z3tP8L
    Link for Selenium Tutorial Full Play List ► bit.ly/3vFR9X5
    Link for TestNG Full Play List ► bit.ly/3jGJ3YT
    Please subscribe to our channel ► bit.ly/2UIvFcm
    and press the bell icon to get updates on latest tutorial.

КОМЕНТАРІ • 13

  • @f.a5148
    @f.a5148 2 роки тому +1

    Thanks brother it helped me a lot

  • @dhirajmahule4951
    @dhirajmahule4951 Рік тому +1

    Great

  • @naveenkumarc7103
    @naveenkumarc7103 3 роки тому

    Put the video for print and count how many common characters in two strings

  • @shreedharbatthad4714
    @shreedharbatthad4714 3 роки тому +1

    10th line

  • @shreedharbatthad4714
    @shreedharbatthad4714 3 роки тому +1

    getting error in 10 in my eclipse

    • @SoftwareTestingAndAutomation
      @SoftwareTestingAndAutomation  3 роки тому +1

      Here is the complete code, Let me know if u need any more help.
      public class CountCharactersInaString {
      public static void main(String[] args) {
      String s = "Learn Java today";
      int count = 0;
      System.out.println("Length of the string is " + s.length());
      for (int i = 0; i < s.length(); i++) {
      if (s.charAt(i) != ' ') {
      count++;
      }
      }
      System.out.println("Count of characters " + count);
      }
      }

  • @PinkiKumari-bt1ei
    @PinkiKumari-bt1ei Рік тому

    Why so much line of code just use length function u will get it

    • @tokonboy8093
      @tokonboy8093 Рік тому

      It will count space also...but space is not character

  • @nehashahi4117
    @nehashahi4117 3 роки тому

    it showing error.

    • @SoftwareTestingAndAutomation
      @SoftwareTestingAndAutomation  3 роки тому +2

      Where You are getting error ?
      Here is the complete code, Let me know if u need any more help.
      public class CountCharactersInaString {
      public static void main(String[] args) {
      String s = "Learn Java today";
      int count = 0;
      System.out.println("Length of the string is " + s.length());
      for (int i = 0; i < s.length(); i++) {
      if (s.charAt(i) != ' ') {
      count++;
      }
      }
      System.out.println("Count of characters " + count);
      }
      }

    • @nehashahi4117
      @nehashahi4117 3 роки тому +1

      @@SoftwareTestingAndAutomation thanku. now working fine.