Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.company;
- public class Main {
- public static void main(String[] args) {
- String str1, str2,str3, str4;
- str1= "Andrey Yerzhov";
- str2="ICS126";
- str3="Annna";
- str4="Yerzhov Andrey Alexandrovich";
- StringMethods str = new StringMethods();
- System.out.print("Task #1. String ends with 'ed': ");
- if(str.StringEnding(str1)) System.out.println("True");
- else System.out.println("False");
- System.out.print("Task #2. The sum of all digits in the string = ");
- System.out.println(str.SumOfDigit(str2));
- System.out.print("Task #3. Length of the longest block = ");
- System.out.println(str.LongestBlock(str3));
- System.out.println("Task #4. All words founded in the string:");
- str.FindWords(str4);
- System.out.print("Task #5. The mix of two strings:");
- str.TwoStrings(str2,str3);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement