SPLIT... seems to be simple but do not know how

simply2703

New member
Local time
Today, 06:20
Joined
Mar 15, 2010
Messages
2
Hi all,

I am just a freshman with Crystal Reports 2008. Now I am facing with a problem as following:

I have some name strings - "Vu Thi Mai Hoang", "Nguyen Phuong Loc", etc. I want to retrieve their last names. That means I want to get "Hoang" and "Loc". Here is my demo code:

Code:
StringVar myName = "";
numberVar  myCount := 0 ;
StringVar array Regions;
 
Regions := Split("Vu Thi Mai Hoang");
myCount= count(Regions);
myName:= Regions(myCount);
 
formula = myName;

Then I got an error message "The remaining text does not appear to be part of the formula".

Could you give me some suggestion?

Thank you so much!
 
The Split is fine. But to pull a value from the array, use square brackets (i.e., myName := Regions[myCount];)
 
thanks kevlray
 

Users who are viewing this thread

Back
Top Bottom