Kodi Community Forum
Escaping a string? - Printable Version

Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Skinning (https://forum.kodi.tv/forumdisplay.php?fid=12)
--- Thread: Escaping a string? (/showthread.php?tid=355162)



Escaping a string? - HomerJau - 2020-06-14

I have an expression where I’m testing for a file name with text ‘Quad+’ but it fails as it sees the ‘+’ as a string concatenation.

<value condition="String.Contains(Player.Filename,Quad+)">4.1</value>

How can I escape the plus sign?

THX


RE: Escaping a string? - ronie - 2020-06-14

not possible. but perhaps the workaround mentioned in this thread could also work for you: https://forum.kodi.tv/showthread.php?tid=352495


RE: Escaping a string? - HomerJau - 2020-06-14

Thanks ronie.

That's not going to work in my case but its a great idea:

Quote:what about this for HDR10+
String.Contains(ListItem.Filenameandpath,.HDR10) + !String.Contains(ListItem.Filenameandpath,.HDR10.)

And this for HDR10
String.Contains(ListItem.Filenameandpath,.HDR10.)

I've got hundreds of files and folders using the naming 'Quad+'. I guess I'll need to rename them all...


RE: Escaping a string? - AchillesPunks - 2020-06-14

It tied to a texture? If so this should work just fine. I have my movies show HDR10+
open image in a new tab to show better
Image


<control type="image">
<include>mediaflags_large_layout</include>
<texture background="true">$VAR[mediaflags_large_path]/video/hdr10+.png</texture>
<visible>String.Contains(ListItem.FileNameAndPath,hdr10+)</visible>
</control>


This forum uses Lukasz Tkacz MyBB addons.