Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

split() - JAVA vs. PERL

Empfohlene Antworten

Hallo an alle! 8)

ich habe eine Frage, die mich sehr beschäftigt..

PERL:

my ($name, $vorname, $beruf, $strasse, $ort) = split("\t", $line);

kann ich das selbe in Java machen ohne dazu ein array zu benutzen?

Denn bei 3-4 variablen ist noch ok, aber was ist mit 20-30?

Für jeden Wert eine Zeile, um in dazugehörige Vars schreiben?

momentan ist so bei mir in Java

String line = ".....";

String[] data = line.split("\\t");

for(...){

// array auslesen

}

wenn du 30 Variablen als Split in eine Reihe schreibst ist die übersicht eh hinüber ^^

PERL:

my ($name, $vorname, $beruf, $strasse, $ort) = split("\t", $line);

kann ich das selbe in Java machen ohne dazu ein array zu benutzen?

Nicht das ich wüßte. Aber wie Aiun schon richtig erwähnt hat, 30 Variablen sind etwas unübersichtlich und ein Fall für ein Array.

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Konto

Navigation

Suchen

Suchen

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.