Split function not working


#1

Using Split function retuens error “Uncaught TypeError: str.split is not a function.
line 226 column 25” . This happens every time . this is my code :

  Dim d,n,nss
  d = new Date()
  panchang.calculate(d)
  n = panchang.Nakshatra.start
  nss = Split(n," ")

How to solve this ?


#2

Hi,

Have you tried put the split function in lowercase (split not Split)?


#3

Are you sure panchang.Nakshatra.start is a string?

MsgBox typeof(panchang.Nakshatra.start)

#4

Yes that is a valid string and that is displayed in msgbox or text area .


#5

Does MsgBox typeof(panchang.Nakshatra.start) display ‘string’?


#6

No ! that displays “object” . after using cStr(n) it worked ! thanks .