18 January 2026:


This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.



Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.

Split and join functions

arunbalaarunbala Members
edited November -1 in Sahi - Open Source
Hi,
I just want to split the following systemdate" Feb 08,2012. And i have to change it as"Feb 10,2012" using Split function. After Split and calculations i have to rejoin them.

Pls provide me the suggestions.

Thnx...

Comments

  • Hi arunbala

    did you take a look at some javascript references like http://www.tizag.com/javascriptT/javascript-string-split.php
    you could do something like
    $temp="Feb 08, 2012".split(" ");
    month =$temp[0];
    $dayYear=$temp[1].split(",");
    $day=$dayYear[0[;
    $year=$dayYear[1]
    
    this may be no good looking code but i hope the functionality is clear

    I'd say ther eare easier ways then useing "join".. like $rejoinedDate=$month+" "+$day+","+$year
    but if you really like to:
    $dayYear=[$day, $year].join(",");
    $rejoinedDate=[$month, $dayYear].join(" ");
    

    Regards
    Wormi
Sign In or Register to comment.