First split method split the whole pdf data into array of 2 elements, first element of array contains text before “GSTIN of SpiceJet Limited :” and second element contains text after “GSTIN of SpiceJet Limited :”
So i took second element from array which contains required text for further processing. Since 2nd element in array contains text in multiple lines so i splitted the 2nd array element with respect to newline. So i got new array with each line as one array element.
Since value is present in first element of new array, so i took index of the element as “(0)”. Trim is used to remove extra spaces front and back of the string.
If you still have any doubts let me know