Created
March 6, 2012 20:32
-
-
Save Linusstrom/1988801 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class Siffra { | |
public static void main(String[] args) { | |
Scanner myScanner = new Scanner(System.in); | |
String string0; | |
System.out.print("Skriv in en sträng: "); | |
string0 = myScanner.next(); | |
if(string0x.startsWith("0|1|2|3|4|5|6|7|8|9")) { | |
System.out.println("Strängen börjar med en siffra."); | |
} else { | |
System.out.println("Strängen börjar inte med en siffra."); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment