-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fcbe0e4
commit dc5e8ed
Showing
4 changed files
with
130 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
|
||
public class App{ | ||
|
||
App(){ | ||
|
||
} | ||
public static void main(String[] args) { | ||
|
||
|
||
// replaceAll() من خلالها يمكنك استبداله جزء من النص بجزء جديد | ||
// replaceFirst() يقوم بإستبداول قيمة يطابق مع الجزء المحدد من النص , بالجزء جديد | ||
// isEmpty() يستخدم لتحقق إذا كان متغير من نوع بيانات نصي خالي من بيانات او لا | ||
// lastIndexOf() تمركز اخر جزء يطابق مع الجزء المحدد | ||
// startsWith() يستخدم لتحقق إن كان النص يبدأ بجزء الذي تحدده او لا | ||
// endsWith() يستخدم لتحقق إن كان النص ينتهي بجزء الذي تحدده او لا | ||
String text = "Java, I like Java."; | ||
text = text.replaceFirst("not", "@"); | ||
boolean isEmpty = text.isEmpty(); | ||
int lastIndexOf = text.indexOf("Java"); | ||
|
||
boolean startsWith = text.startsWith(" "); | ||
boolean endsWith = text.endsWith("."); | ||
// if(text.isEmpty()){ | ||
|
||
// }else{ | ||
|
||
// } | ||
System.out.println(endsWith); | ||
|
||
} | ||
|
||
} | ||
|
||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
|
||
|
||
|
||
// بالدرس 9 تم شرح عناصر التالية | ||
// toLowerCase() Converts a string to lower case letters - تحويل النص إلى احرف الصغيرة | ||
// toUpperCase() Converts a string to upper case letters - يحول النص إلى أحرف كبيرة | ||
// concat() Appends a string to the end of another string - إلحاق النص بنهايةأخرى | ||
// length() Returns the length of a specified string - إرجاع طول النص المحدد | ||
// إرجاع تمركز نص الذي يطابق مع الجزء المحددة | ||
// indexOf() Returns the position of the first found occurrence of specified characters in a string | ||
|
||
// بالدرس 30 تم شرح عناصر التالية | ||
// charAt() Returns the character at the specified index (position) - إرجاع الحرف عند الفهرس المحدد ) | ||
// substring Extracts the characters from a string - يستخدم لقطع النص وإعادة لك الجزء المحدد الذي قطعته | ||
// trim() Removes whitespace from both ends of a string يحذف الفراغات من بداية ونهاية النص | ||
|
||
// equals() // يقارن 2 نصوص . ويقوم بإعادة | ||
// true | ||
// إذا تطابق 2 نصوص , ويقوم بإعادة | ||
// false | ||
// إذا لم تطابق 2 نصوص | ||
Compares two strings. Returns true if the strings are equal, and false if not | ||
|
||
//يبحث في نص لقيمة محددة ، ويعيد نص جديدة حيث يتم استبدال القيم المحددة | ||
// replace() // Searches a string for a specified value, and returns a | ||
// new string where the specified values are replaced | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
|
||
public class App{ | ||
|
||
App(){ | ||
|
||
} | ||
public static void main(String[] args) { | ||
|
||
|
||
// replaceAll() من خلالها يمكنك استبداله جزء من النص بجزء جديد | ||
// replaceFirst() يقوم بإستبداول قيمة يطابق مع الجزء المحدد من النص , بالجزء جديد | ||
// isEmpty() يستخدم لتحقق إذا كان متغير من نوع بيانات نصي خالي من بيانات او لا | ||
// lastIndexOf() تمركز اخر جزء يطابق مع الجزء المحدد | ||
// startsWith() يستخدم لتحقق إن كان النص يبدأ بجزء الذي تحدده او لا | ||
// endsWith() يستخدم لتحقق إن كان النص ينتهي بجزء الذي تحدده او لا | ||
String text = "Java, I like Java."; | ||
text = text.replaceFirst("not", "@"); | ||
boolean isEmpty = text.isEmpty(); | ||
int lastIndexOf = text.indexOf("Java"); | ||
|
||
boolean startsWith = text.startsWith(" "); | ||
boolean endsWith = text.endsWith("."); | ||
// if(text.isEmpty()){ | ||
|
||
// }else{ | ||
|
||
// } | ||
System.out.println(endsWith); | ||
|
||
} | ||
|
||
} | ||
|
||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
|
||
|
||
|
||
// بالدرس 9 تم شرح عناصر التالية | ||
// toLowerCase() Converts a string to lower case letters - تحويل النص إلى احرف الصغيرة | ||
// toUpperCase() Converts a string to upper case letters - يحول النص إلى أحرف كبيرة | ||
// concat() Appends a string to the end of another string - إلحاق النص بنهايةأخرى | ||
// length() Returns the length of a specified string - إرجاع طول النص المحدد | ||
// إرجاع تمركز نص الذي يطابق مع الجزء المحددة | ||
// indexOf() Returns the position of the first found occurrence of specified characters in a string | ||
|
||
// بالدرس 30 تم شرح عناصر التالية | ||
// charAt() Returns the character at the specified index (position) - إرجاع الحرف عند الفهرس المحدد ) | ||
// substring Extracts the characters from a string - يستخدم لقطع النص وإعادة لك الجزء المحدد الذي قطعته | ||
// trim() Removes whitespace from both ends of a string يحذف الفراغات من بداية ونهاية النص | ||
|
||
// equals() // يقارن 2 نصوص . ويقوم بإعادة | ||
// true | ||
// إذا تطابق 2 نصوص , ويقوم بإعادة | ||
// false | ||
// إذا لم تطابق 2 نصوص | ||
Compares two strings. Returns true if the strings are equal, and false if not | ||
|
||
//يبحث في نص لقيمة محددة ، ويعيد نص جديدة حيث يتم استبدال القيم المحددة | ||
// replace() // Searches a string for a specified value, and returns a | ||
// new string where the specified values are replaced | ||
|