public boolean endsWith(String suffix) |
package java like ; public class EndsWithExample { public static void main(String args[]) { String str1 = new String("This is a test String"); String str2 = new String("Test ABC"); booleanvar1 = str1.endsWith("String"); booleanvar2 = str1.endsWith("ABC"); boolean var3 = str2.endsWith("String"); boolean var4 = str2.endsWith("ABC"); System.out. print ln("str1 ends with String: " + var1); System.out. print ln("str1 ends with ABC: " + var2); System.out. print ln("str2 ends with String: " + var3); System.out. print ln("str2 ends with ABC: " + var4); } } |
str1 ends with String: true str1 ends with ABC: false str2 ends with String: false str2 ends with ABC: true |
package java like ; public class Test3 { public static void main(String[] args) { String str = "Learn Java Programming with examples"; System.out. print ln("str ends with <<examples>> " + str.endsWith("examples")); System.out. print ln("str ends with <<with examples>> " + str.endsWith("with examples")); System.out. print ln("str ends with <<ples>> " + str.endsWith("ples")); System.out. print ln("str ends with <<exam>> " + str.endsWith("exam")); System.out. print ln("str ends with <<Learn>> " + str.endsWith("Learn")); System.out. print ln("str ends with <<Java Programming>> " + str.endsWith("Java Programming")); System.out. print ln("str ends with <<s>> " + str.endsWith("s")); System.out. print ln("str ends with <<ple>> " + str.endsWith("ple")); } } |
str ends with <<examples>> true str ends with <<with examples>> true str ends with <<ples>> true str ends with <<exam>> false str ends with <<Learn>> false str ends with <<Java Programming>> false str ends with <<s>> true str ends with <<ple>> false |
سایت جاواپرو با هدف تولید محتوای آموزشی با کیفیت رایگان در زمینه برنامه نویسی جاوا و اندروید فعالیت خود را در سال 1395 شروع کرد.امیدواریم بتوانیم دامنه گسترده تری از موضوعات پر نیاز در زمینه برنامه نویسی جاوا و اندروید را البته با حمایت شما پوشش دهیم.
تلفن: 09301904690