array-rank
(array-rank array)
Returns the number of dimensions of array: 0 for a rank-0 array ((make-array nil)), 1 for a vector, 2 for a two-dimensional array, and so on for higher ranks. It equals the length of the list returned by array-dimensions.
A string is a rank-1 array of characters, so its rank is 1.