SageTV Community  

Go Back   SageTV Community > SageTV Customizations > SageTV Studio

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 10-10-2009, 06:02 AM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 4,058
How to shorten a string?

Is there a java string method available that shortens a string to some maximum specified length?

Also, where can I find a list of java methods available so I do not have to ask these silly questions?

Thanks,

Tom
__________________

Sage Server: ASUS/Intel C2D based system w/4GB RAM. WinXP Home, Hauppauge PVR 150, Hauppauge HVR-2250 and an HDHR. Runs headless. Accessed via VNC when necessary. Four HD-300 Extenders.
Reply With Quote
  #2  
Old 10-10-2009, 06:14 AM
Fuzzy's Avatar
Fuzzy Fuzzy is offline
SageTVaholic
 
Join Date: Sep 2005
Location: Riverside, CA
Posts: 6,576
you can use string.substring(0,n) to return the first n characters from the string. I've actually found this a very handy page for processing strings in ANY language.
__________________
Sage Server: Phenom II X4, 16GB RAM, Win7HP, 1x1TB (system/misc-imports), 2x750GB+3x2TB(recordings/media)
Sources: Two R-5000HD equipped ViP-211's for Dish Network, HDHR3 Dual for OTA
Primary Client: i3-530, 2GB RAM, Win7HPx86, miniITX H55 MB, 160GB laptop drive, Samsung HLT-6189S
Other Clients: Phenom II X2 545 w/8GB and HD6670 in Master Bedroom, MVP in kids play room
Reply With Quote
  #3  
Old 10-10-2009, 07:22 AM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,095
Quote:
Originally Posted by Fuzzy View Post
you can use string.substring(0,n) to return the first n characters from the string. I've actually found this a very handy page for processing strings in ANY language.
As FUZZY said substring

Google and yahoo search help me allot I have searched them many time for java code examples

Also sun has great resources

I will shoot you a email with other links I use that could be helpful to you
Reply With Quote
  #4  
Old 10-10-2009, 08:49 AM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,074
Quote:
Originally Posted by tmiranda View Post
Also, where can I find a list of java methods available so I do not have to ask these silly questions?
http://java.sun.com/javase/6/docs/api/
__________________
-- Greg
Reply With Quote
  #5  
Old 10-10-2009, 09:02 AM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 4,058
OK, thanks. Now I have lots of new toys to play with

What syntax do I use to use these APIs in Studio?

Looking at the substring() method it uses examples like: "hamburger".substring(0,n).

I'm assuming in Studio I need java_lang_String_substring() but substring only accepts 2 parameters (start,end). Where do I specify the string?

Thanks,

Tom
__________________

Sage Server: ASUS/Intel C2D based system w/4GB RAM. WinXP Home, Hauppauge PVR 150, Hauppauge HVR-2250 and an HDHR. Runs headless. Accessed via VNC when necessary. Four HD-300 Extenders.
Reply With Quote
  #6  
Old 10-10-2009, 09:23 AM
Opus4's Avatar
Opus4 Opus4 is offline
Administrator
 
Join Date: Sep 2003
Location: NJ
Posts: 19,247
Quote:
Originally Posted by tmiranda View Post
What syntax do I use to use these APIs in Studio?

Looking at the substring() method it uses examples like: "hamburger".substring(0,n).

I'm assuming in Studio I need java_lang_String_substring() but substring only accepts 2 parameters (start,end). Where do I specify the string?
See "Using java Code" on page 152 of the Studio PDF manual.

I would usually say the default STV has java examples, but in this case, you might as well use the SageTV API call: Substring(). You can also use Size() to get the length of the string.

- Andy
__________________
SageTV v7.1.9 is available here.
- Read the SageTV FAQ and PDF User's Guides for 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.
Before you ask: no, I can't say "when".
Reply With Quote
  #7  
Old 10-10-2009, 09:59 AM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 4,058
DOH! I didn't even notice there was s Sage API for it. It just shows you that what my wife says about me is true
__________________

Sage Server: ASUS/Intel C2D based system w/4GB RAM. WinXP Home, Hauppauge PVR 150, Hauppauge HVR-2250 and an HDHR. Runs headless. Accessed via VNC when necessary. Four HD-300 Extenders.
Reply With Quote
Reply


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

Advanced Search
Display Modes

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
What is the best way to get the width in pixels of a string? BobPhoenix SageTV Studio 4 12-16-2007 01:56 AM
Stripping out illegal chars from string evilpenguin SageTV Studio 3 10-16-2007 12:10 AM
Studio String help evilpenguin SageTV Studio 1 06-10-2006 08:55 PM
String manipulation in Studio Alfiegerner SageTV Studio 3 05-16-2006 05:24 PM
OK to string tv splitters/boosters together? jimbobuk General Discussion 5 05-16-2003 10:01 AM


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


Powered by vBulletin® Version 3.7.6
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Copyright 2003-2005 SageTV, LLC. All rights reserved.