Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Program
- {
- public static void main(String[] args) {
- String text = "Here is the text";
- int count = text.split(" ").length - 1;
- if(count > 0){
- System.out.println("عدد المسافات:"+count);
- }else{
- System.out.println("لا توجد مسافات");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement