Concept

How can you compute a substring of a string?

ComputerScienceOne / Arrays of Strings

"There are two methods that allow you to compute a substring of a string. The first allows you to specify a beginning index with the entire remainder of the string being included in the returned string. The second allows you to specify a beginning index as well as an ending index. In both cases, the beginning index is inclusive (that is the resulting string includes the character at that index), but in the second, the ending index is exclusive (the character at the end index is not included).\n\nString name = \"Thomas Alan Waits\";\n\nString firstName = name.substring(0, 6); //\"Thomas\"\n\nString middleName = name.substring(7, 11); //\"Alan\"\n\nString lastName = name.substring(12); //\"Waits\"\n\nThe result of the two argument substring() method will always have length equal to endIndex - beginIndex."

Related Ideas

How can you compute a substring of a string? | ComputerScienceOne | Bifalgorithm | Bifalgorithm