I am trying to duplicate an if statement that was done in our VB
program in Java Program. I have search the groups and the web trying
to get an understanding of doing it in java but have failed.
The VB statement is:
If Left(value,4) = "LIST" Then
(Do some programming logic)
End if
Thank you for your advice and any input where to look for information.
DG
su_dang@hotmail.com - 24 Oct 2006 15:29 GMT
> I am trying to duplicate an if statement that was done in our VB
> program in Java Program. I have search the groups and the web trying
[quoted text clipped - 11 lines]
>
> DG
If value is a string then you can use
value.substring(0, 4)
to extract the leftmost 4 characters
gibboda - 24 Oct 2006 18:49 GMT
> > I am trying to duplicate an if statement that was done in our VB
> > program in Java Program. I have search the groups and the web trying
[quoted text clipped - 15 lines]
> value.substring(0, 4)
> to extract the leftmost 4 characters
Thank you.
Oliver Wong - 24 Oct 2006 16:06 GMT
>I am trying to duplicate an if statement that was done in our VB
> program in Java Program. I have search the groups and the web trying
[quoted text clipped - 7 lines]
>
> End if
if (value.startsWith("LIST")) {
//do some programming logic.
}
(and similarly with endsWith)
> Thank you for your advice and any input where to look for information.
Look here for information: http://java.sun.com/j2se/1.5.0/docs/api/
- Oliver
gibboda - 24 Oct 2006 18:49 GMT
> >I am trying to duplicate an if statement that was done in our VB
> > program in Java Program. I have search the groups and the web trying
[quoted text clipped - 19 lines]
>
> - Oliver
Thank you,
DG
Thomas Hawtin - 24 Oct 2006 16:47 GMT
> I am trying to duplicate an if statement that was done in our VB
> program in Java Program. I have search the groups and the web trying
[quoted text clipped - 7 lines]
>
> End if
if (value.startsWith("LIST")) {
...
}
> Thank you for your advice and any input where to look for information.
I suggest looking at the API docs:
http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html
Tom Hawtin
gibboda - 24 Oct 2006 18:50 GMT
> > I am trying to duplicate an if statement that was done in our VB
> > program in Java Program. I have search the groups and the web trying
[quoted text clipped - 19 lines]
>
> Tom Hawtin
Thank you,
DG