Count of selected rows

I am using enableMultiSelect() and getSelectedRowId() functionality in the grid. Is there a way to find out how many rows the user has selected?

Thanks

getSelectedRowId() method returns the list of ids of the selected rows.

list=mygrid.getSelectedRowId() arr=list.split(",") number=arr.length //number of selected rows