SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV Studio
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV Studio Discussion related to the SageTV Studio application produced by SageTV. Questions, issues, problems, suggestions, etc. relating to the Studio software application should be posted here.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 05-16-2006, 04:26 PM
Alfiegerner Alfiegerner is offline
Sage Aficionado
 
Join Date: Oct 2005
Location: Auckland, NZ
Posts: 383
String manipulation in Studio

Hi,

I'm new to studio and don't really know if this is outside of its remit or not. I want to remove all instances of a pariticular character in a string.

Specifically I want the imdb lookup in SageMC to remove all stars from the Airing title.

At the moment it does this:

AddStaticContext("SearchString", GetAiringTitle(Airing))

whereas I'd want it to do something like:

AddStaticContext("SearchString", str_replace("*", "", GetAiringTitle(Airing)))

Is this possible?

Last edited by Alfiegerner; 05-16-2006 at 05:30 PM.
Reply With Quote
  #2  
Old 05-16-2006, 04:45 PM
dflachbart dflachbart is offline
SageTVaholic
 
Join Date: Jan 2006
Location: Brookfield, CT
Posts: 2,743
Quote:
Originally Posted by Alfiegerner
Hi,

I'm new to studio and don't really know if this is outside of its remit or not. I want to remove all instances of a pariticular character in a string with, that is.

Specifically I want the imdb lookup in SageMC to remove all stars from the Airing title.

At the moment it does this:

AddStaticContext("SearchString", GetAiringTitle(Airing))

whereas I'd want it to do something like:

AddStaticContext("SearchString", str_replace("*", "", GetAiringTitle(Airing)))

Is this possible?

Not sure if the escape character for the "*" is correct (the second parameter in 'replaceAll' is a regular expression so the "*" has a special meaning), but you could try

AddStaticContext("SearchString", java_lang_String_replaceAll(GetAiringTitle(Airing), "\*", ""))


Dirk
Reply With Quote
  #3  
Old 05-16-2006, 05:15 PM
Opus4's Avatar
Opus4 Opus4 is offline
Administrator
 
Join Date: Sep 2003
Location: NJ
Posts: 19,624
And, I think you're going to have to use "\\*".

- Andy
__________________
SageTV Open Source v9 is available.
- Read the SageTV FAQ. Older PDF User's Guides mostly still apply: SageTV V7.0 & SageTV Studio v7.1.
- Hauppauge remote help: 1) Basics/Extending it 2) Replace it 3) Use it w/o needing focus
- HD Extenders: A) FAQs B) URC MX-700 remote setup
Note: This is a users' forum; see the Rules. For official tech support fill out a Support Request.
Reply With Quote
  #4  
Old 05-16-2006, 05:24 PM
Alfiegerner Alfiegerner is offline
Sage Aficionado
 
Join Date: Oct 2005
Location: Auckland, NZ
Posts: 383
Thanks guys, much appreciated - the second slash was needed btw.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 01:53 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.