BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 03-15-2010, 06:18 AM   #1 (permalink)
New Member
 
Join Date: Mar 2010
Model: 7100t
PIN: N/A
Carrier: dnt no
Posts: 5
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Diffrent text colour in same string

Please Login to Remove!

Hi I have a string of text which will be constantly changing since It downloads every time you start the app, but that is not the problem I just want you to know the situation.

Know the string holds a series of information in the same format such as name, date, status etc. So how do I change the colour of only one part of the string and use a different colour for other parts. I will oly need three colours.

I don't think that creating three text fields with diffrent colous will help, as the string neds to be rendered in the order it is in.

I thought perhaps finding a key value in the string such as a word which I can do between each part of the series, and then creating a new rich text field whith an asigned colour depending on a value in the string? However I do not know how to do that.

Please help, thanks.
Offline  
Old 03-15-2010, 10:09 AM   #2 (permalink)
Knows Where the Search Button Is
 
Join Date: Mar 2010
Model: N/A
PIN: N/A
Carrier: Fledge
Posts: 43
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

I think you are looking for advice on basic string parsing functions. Look at the String functions "substring" and "indexOf" at API Reference: String Class which can be used to find the position of text in a string and create a new string based on the starting and ending position parameters.
Offline  
Closed Thread


Thread Tools

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

KM44C4100CK-6 SEC/SAMSUNG 4M x 4Bit CMOS Dynamic RAM DRAM Fast Page mode 5V 60ns
$2.0
KM44C4100CK-6 SEC/SAMSUNG 4M x 4Bit CMOS Dynamic RAM DRAM Fast Page mode 5V 60ns pictureSimplex R308 30 ton hydraulic ram cylinder head only used twice
$700.0
Simplex R308 30 ton hydraulic ram cylinder head only used twice pictureDodge Ram Dash Glove Box 94 95 96 5CU62PF6 Medium Quartz Trim Code D5
$39.95
Dodge Ram Dash Glove Box 94 95 96 5CU62PF6 Medium Quartz Trim Code D5 picture95 Dodge Ram 5.9 cummins tubo diesel 12 valve timing cover & bolts
$65.0
95 Dodge Ram  5.9 cummins tubo diesel 12 valve timing cover & bolts picture2 Rolls Ram Board Seam Tape (Each Roll 3"x164')
$22.5
2 Rolls Ram Board Seam Tape (Each Roll 3






Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.