04-11-2013 06:39 AM
i have two strings
String first = "Teach the children not to receive anything for nothing; let them earn by hardwork the things they seek.";
and i have edit field when i enter any word in edit filed , if that enterd word will exist in my first string that will show the full first string.
for eg. i got the text from edit field and put into String second = "Teach";
if the second string will exist in my first(string) that will display me the whole first string.can u help me
04-11-2013 07:39 AM
04-11-2013 08:11 AM
i found that there is no String.Contain() method,in BB. keword filter did not solve my issue. i have 50 thoughts added to my vector and i put them all into string and my string have 50 thoughts,and i have edit field when i enter any word in edit filed , if that enterd word will exist in that string that will show all the strings that contains the edit field text..
04-11-2013 08:58 AM
There are various SringUtilities methods hat I have found useful in circumstances like this too.
Since you have to write this yourself, here are some general instructions:
a) Create a button so that the user can enter the Search field and then press the Button.
b) Create a new VerticalFieldManager
c) On Button Click, search your Vector and for each match, create a LabelField containing the Text. Add the LabelField to the VerticalFieldManager
d) Add the VerticalFieldManager to the Screen
e) If you have previously done a search, remove associated VerticalFieldManager from the screen.
There are many different ways of achieving similar effects, but get this one working first and then you decide if you like it..
04-11-2013 09:01 AM
i'm new to blackberry can u explain String.indexOf(String str) method to me with an example.
If you are new it should be extra important to get to know the API documentation: