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 10-10-2009, 06:02 AM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,851
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: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD 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: Jurupa Valley, CA
Posts: 9,957
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.
__________________
Buy Fuzzy a beer! (Fuzzy likes beer)

unRAID Server: i7-6700, 32GB RAM, Dual 128GB SSD cache and 13TB pool, with SageTVv9, openDCT, Logitech Media Server and Plex Media Server each in Dockers.
Sources: HRHR Prime with Charter CableCard. HDHR-US for OTA.
Primary Client: HD-300 through XBoxOne in Living Room, Samsung HLT-6189S
Other Clients: Mi Box in Master Bedroom, HD-200 in kids room
Reply With Quote
  #3  
Old 10-10-2009, 07:22 AM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
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,083
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: 5,851
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: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD 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,624
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 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
  #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: 5,851
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: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders.
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

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 02: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 06:06 PM.


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