If you're really getting a performance problem from the large array (dont' optimize prematurely), you could use slice to extract the single strings and indexOf/lastIndexOf to find their positions:
str.slice(0, str.indexOf(','))
and
str.slice(str.lastIndexOf(',')+1) // 1==','.length