i am new to java and jsp I have a doubt. In Vb i am using trim for removing white spaces. and also i am using to trim from left as LEFT(string, number) and for trimming from Right as RIGHT(string, number). but in java or jsp how can we do . I tried but i could not get the result.below one is the code i tried.
String strsql=" select * from emp where" ;
strsql = Trim(strsql)
If (Right(strsql, 3) == "and" )
strsql = Left(strsql, length(strsql) - 3)
If (Right(strsql, 5) == "where" )
strsql = Left(strsql, length(strsql) - 5)
Note: I used these in predicting as.....
length -- to know the length of the string
Trim -- to remove the white spaces in the string
Right(strsql, 3) -- to check the String from rightside upto 3 characters.
Left(strsql, length(strsql) - 3) -- to remove 3 characters from left side of the string.
pls do me correct in this regard and give me one example so that i can understand well.