Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- System.out.println("Cart count is:-" +Cartcount.getText());
- /*String s1="(0)";
- String replaceString=s1.replace('(',' ');
- String replaceString1=s1.replace(')',' ');
- //replaces all occurrences of 'a' to 'e'
- System.out.println(replaceString);
- System.out.println(replaceString1); */
- String str = "(0)";
- System.out.println("Split");
- String[] arr = str.split("(0)",2);
- for (String w : arr) {
- System.out.println(w);
- }
- // System.out.println("Split array length: "+arr.length);
- /* String Cartcount=driver.findElement(By.id("cart_item_count")).getText();
- System.out.println(Cartcount);
- String tem[]=Cartcount.split(" ");
- System.out.println(tem[2]);
- String temp[]=tem[2].split("\(");
- System.out.println(temp[1]);*/
- if (Cartcount.equals(0)) {
- System.out.println("Cart is empty") ;
- }
- else
- {
- System.out.printf("Cart is not empty");
- }
- Output-
- Cart count is:-(0)
- Split
- (
- )
- Cart is not empty
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement