You can simply use split
method from String
class.
Split file=android.txt&data=it contains android data
on &
to get array of "file=android.txt"
and "data=it contains android data"
.
Then you can split each of this elements on =
so
file=android.txt
-> file
, android.txt
data=it contains android data
-> data
, it contains android data
So your code can look like
foreach element in data.split(&)
array = element.split(=)
get second element from array
solved Split string using substring [closed]