charan sri

charan sri

  • NA
  • 10
  • 22k

In string concatenation display 0 instead of null

Aug 13 2012 6:42 AM
hi,
I have a form which contains textboxes,"search" button.when user enter the values and click on the button I have to display the search details. and
I have to display no.of searchresults:
no.of search results i have obtained by using array.length; I want to use this value in another view page.so I put this value in the sessionStorage.setItem("getCount",len);
I am concatinating this value in the other view page like:

Search Results:" + sessionStorage.getItem('getCount') + "

I am getting the number of search results when user enters the value in the form.
but when user enter no values in the form then at the searchresults: it is displaying "null".but i want to display "0" insted of null.
how can i do this.

Answers (3)