Skip to main content
GameDev.net gamedev.net
🔒 Locked

[java] Some random questions

Started by Master Of Souls Feb 21, 2003 at 3:19 PM 1 replies 300+ views
Original Post
Master Of Souls
Master Of Souls
Hey, I have a couple of questions: 1. Can you search an integer for a certain number? 2. How do you edit strings, like read the 4th character for example, and get the length of a string. 3. How do you search a string for certain text 4. How do you read from a text file and put the result in a string, and how do you handle multiple lines? Thanks in advance!
stustill
stustill
Check out the String class in the api. To search an integer for a number I presume you mean something like this 1234567, you want to search for 5. You could either use modulus (%) and write a function to do it, or you could convert it to a String (String numberString = "" + (your-int)) and then call methods on the string to locate it, as you will find from String class!

Stustill

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.