How can replace string use
replace(/;/g, "/") or another that not use split(array)?
ex: ;001;;002;;; -> 001/002
- <script type="text/javascript">
- function test()
- {
- var row=$('table tr');
- var temp=[];
- $(row).each(function(){
- var col=$(this).find('td');
- var tdtext="";
- $(col).each(function(){
- var _txt=[];
- temp=$(this).text().split(';');
- $(temp).each(function(i){
- if(temp[i]!="")
- {
- _txt.push(temp[i]);
- }
- });
- $(_txt).each(function(i){
- tdtext+=_txt[i]+"/";
- });
- $(this).text(tdtext);
- });
- });
- }
- $(document).ready(function(){
- test();
- });
- </script>
Mr Lam