I have a xml file that has a hyphen"-" inside, how can I display the hyphen into the Corona apps?
Part of the xml file:
<data>Value : 54-57</data>
For now I can only display 5457 which became totally wrong.
Parts of the code for xmlparse:
print("found item")
if founditem == true then
for i=1,#Item do
for j=1,#Item[i].child do
if Item[i].child[j].name == "data" then
ValueReading[i] = simplifyData(Item[i].child[j].value)
end
end
end
end
Parts for the "SimplifyData" code:
function simplifydata(data)
data = string.gsub(data,"%a", "")
data = string.gsub(data,"%s","")
data = string.gsub(data,":","")
data = string.gsub(data,"-","")
data = tonumber(data)
return data
end
Any ideas how can I make the hyphen display? Thanks
No comments:
Post a Comment