Posts: 74
Joined: Jan 2017
Reputation:
0
What is the best way to strip a sting with a particular character. Kodi database shows multiple country seperated by forward slash
United Kingdom / United States of America
I wanted to get only the first country into the variable . Any help will be appreciated
Enigma
Posts: 74
Joined: Jan 2017
Reputation:
0
Thanks for this manfeed. Since i am novice to the programming, can you please help me how i can get this into a variable. I have tried the below
<variable name="CountryNewVar">
RunScript(script.skin.helper.service,action=stripstring,splitchar=/,string=$INFO[ListItem.Country],output=CountryNew)
<value>$INFO[CountryNew]</value>
</variable>
But i am not getting anything on the variable. Do i need to load skin helper service on the xml?
Posts: 74
Joined: Jan 2017
Reputation:
0
I wanted to show the country details in includes.xml file but wanted the first country to show from $INFO[ListItem.Country if there are multiple countries, Appreciate your help
Posts: 74
Joined: Jan 2017
Reputation:
0
Thanks Jeroen. The stripstring example shows
-----------------------------------------------------------------------
RunScript(script.skin.helper.service,action=stripstring,splitchar=.,string=$INFO[System.BuildVersion],output=kodiversion_main)
The above command will take the Kodi Buildversion Info string and split it on the "." character. The result is the main Kodi version, e.g. "16" or "17". You can access the result in your skin as a window property, in the above example kodiversion_main: $INFO[kodiversion_main)]
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
I wanted the stripped string to be accessible as a variable so that the output can be shown in include.xml. I have Estuary skin and i wanted some changes on the default skin to show some extra details. The current $INFO[ListItem.Country] will have sometime more that one country and i wanted to just show the first one. Each country is seperated by "/"