Scanner nextChar() ?|Programmering / Grafisk formgivning|Forum|Nordichardware

Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
Lost password?
The forums are currently locked and only available for read only access
sp_Feed sp_TopicIcon
Scanner nextChar() ?
silversurfer2
Siktar mot toppen
Medlem
Forum Posts: 97
Member Since:
March 31, 2004
sp_UserOfflineSmall Offline
1
October 7, 2004 - 12:56 pm
sp_Permalink sp_Print

Hur använder man scanner så att an kan läsa in ett tecken???

I Java då.

ren
Kommer du hit ofta?
Medlem
Forum Posts: 833
Member Since:
January 15, 2004
sp_UserOfflineSmall Offline
740844
October 7, 2004 - 1:14 pm
sp_Permalink sp_Print

Ska du bara läsa in ett tecken så vill du förmodligen inte använda klassen Scanner.

Men du kan ju prova med


Scanner s = new Scanner(...);
Sting some_string;
.
.
some_sting = s.next(".");

nästa tecken från inströmmen bör då ligga i some_string.

Edit: stavn

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1030
Currently Online:
Guest(s) 501
Currently Browsing this Page:
2 Guest(s)
Top Posters:
Andreas Galistel: 16287
Jonas Klar: 15897
ilg@dd: 10810
Nyhet: 10607
Mind: 10550
Ctrl: 10355
Gueno: 9881
Guest: 9344
Snorch: 8881
Callister: 8468
Newest Members:
PetrbonFU PetrbonFU
Karine Bembry
Dolores Mcdaniels
Anibal McLeish
Francisca Alt
Alfie Everhart
Lester Huitt
Orlando Jorgensen
Mikki Lundgren
Dakota Kozlowski
Forum Stats:
Groups: 11
Forums: 59
Topics: 146630
Posts: 1300967

 

Member Stats:
Guest Posters: 2
Members: 79425
Moderators: 0
Admins: 11
Administrators: nordicadmin, Henrik Berntsson, Anton Karmehed, Carl Holmberg, Joel Oscarsson, Mikael Linnér, Mikael Schwartz, Andreas Paulsson, Nickebjrk, Mattias Pettersson, EmxL