?
Solved

using split and colors

Posted on 2011-10-19
6
Medium Priority
?
238 Views
Last Modified: 2012-05-12
hi guys
i have a scenario where i will get the following data from backend

Manager: 100
CEO:190
CUSTOMER:900

in my datagrid cell  
if (Manager)
show 100 in the cell and paint the cell as red
if(CEO)
show 190 in the cell and paint the cell as green
if(customer)
show 900 in the cell and paint the cell as yellow

any ideahow i can do that
do i split the strings  and check if ceo or manager or customer?
 

thanks
0
Comment
Question by:royjayd
  • 4
  • 2
6 Comments
 
LVL 29

Expert Comment

by:dgofman
ID: 36997800
Use split function

label.split(":");
0
 

Author Comment

by:royjayd
ID: 36997812
how do i get two seperate strings from Manager: 100 using bel.split(":"); ?
There can be spaces which i would like to trim (space between Manager: and 100 )

thanks
0
 
LVL 29

Expert Comment

by:dgofman
ID: 36997826
How about if you will split like bel.split(": "); with the space

any way if you want to trim string here is a syntax

"     Hello_World    ".split(' ').join('');
0
Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 

Author Comment

by:royjayd
ID: 36997843
ok but what i want to know is how do i get two seperate strings

should it be
var label:String = "Manager: 100";
var string: name = label.split(":");  //will give Manager
var string: number = label.split(":");  //will give 100

is that correct?

thx

0
 
LVL 29

Expert Comment

by:dgofman
ID: 36997920
no

var label:String = "Manager: 100";
var pair:Array = label.split(": ");
var string: name = pair[0]; //will give Manager
var string: number = pair[1]; //will give 100
0
 
LVL 29

Accepted Solution

by:
dgofman earned 2000 total points
ID: 36997924
But correct syntax is

var label:String = "Manager: 100";
var pair:Array = label.split(": ");
if(pair.length == 2){
    var title:String = pair[0]; //will give Manager
     var salary:Number = new Number(pair[1]); //will give 100
}
 
0

Featured Post

Making Bulk Changes to Active Directory

Watch this video to see how easy it is to make mass changes to Active Directory from an external text file without using complicated scripts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

First things first - Preparation We need all the part for this install and it's much nicer to have them all on hand when you need them so here's what's required. Download Eclipse 3.5 32 bit (I like the Classic flavour) from here. (http://www.e…
I am posting this in case anyone runs into similar issues that I did, this may save you a lot of grief: Condition: 1. Your NetBIOS domain name contains an ampersand " & " character.  (e.g. AT&T) 2. You've tried to run any Microsoft installation…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses
Course of the Month9 days, 13 hours left to enroll

612 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question