online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
public class Main { public static void main(String[] args) { String sentence = "Lorem ipsum dolor sit amet, consectetur "; // Remove any trailing punctuation at the end of the sentence sentence = sentence.replaceAll("[^a-zA-Z0-9]+$", ""); // Split the sentence into an array of words using the split method String[] words = sentence.split("\\s+"); // Count the number of words int wordCount = words.length; System.out.println("The number of words is " + wordCount + "."); } }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue