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.

1. Buchstabe groß ???

Empfohlene Antworten

Veröffentlicht

Hi,

ich hätte mal ne Frage.

Ich möchte aus einer Formulareingabe zwecks Datenbankeintrag, den ersten Buchstaben des Wertes den der User eingibt (falls er es nicht selbst macht) in nen Großbuchstaben umwandeln.

Mit toUpperCase funzt es ja leider nicht, da so das ganze Wort in Großbuchstaben umgewandelt wird.

Wäre nett wenn mir einer helfen könnte.

Danke und Gruß,

Ruppes

Hi,

entweder du nutzt die Klasse StringUtils aus dem Commons Projekt unter http://jakarta.apache.org oder du schreibst selber etwas in der Art.


 public String großBuchstabe(String string) {

   return new StringBuffer(string.length())

   .append(Character.toTitleCase(string.charAt(0)))

   .append(string.substring(1))

   .toString();

 } 

Ich schätze mal StringUtils wird das ähnlich machen.

Gruß Jaraz

Ich hoffe, dass ich dein Problem verstanden haben.

Hier meine Lösung.

String s= textField.getText();

String s2="";

if(s.length()>0)

{

String s1=""+s.charAt(0);

s1=s1.toUpperCase();

s2=s1+s.substring(1);

}

javax.swing.JOptionPane.showMessageDialog(null,s2,"Die Anzeige...",javax.swing.JOptionPane.DEFAULT_OPTION);

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

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.