id/email
password
forgot password
about | help | done | prefs | create account
JavaBat java practice problems

String-2 > prefixAgain
prev  |  next  |  chance

Given a string, consider the prefix string made of the first N chars of the string. Does that prefix string appear somewhere else in the string? Assume that the string is not empty and that N is in the range 1..str.length().

prefixAgain("abXYabc", 1) → true
prefixAgain("abXYabc", 2) → true
prefixAgain("abXYabc", 3) → false

...Save, Compile, Run

See Also: Example Code Java help: If Boolean Logic | Strings | While and For Loops | Arrays and Loops


prev  |  next  |  chance   |  JavaBat  >  String-2

Forget It! -- delete my code for this problem 239.0

Copyright Nick Parlante 2006-09 - privacy