Arrays übung

This commit is contained in:
2026-04-24 12:56:46 +02:00
parent 285061d1d7
commit b2e67e1b49
2 changed files with 43 additions and 0 deletions
+41
View File
@@ -0,0 +1,41 @@
using System.Linq;
using UnityEngine;
public class Arrays_Übung : MonoBehaviour
{
public string buchstabenfolge = "Einkommenssteuerbescheid";
public char[] dieBuchstabenHintereinander;
public char[] umgetret;
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
{
int anzahlBuchstaben = buchstabenfolge.Length;
dieBuchstabenHintereinander = new char[anzahlBuchstaben];
umgetret = new char[anzahlBuchstaben];
for (int i = 23; i < anzahlBuchstaben; i++)
{
dieBuchstabenHintereinander[i] = buchstabenfolge[i];
}
for (int i = 23; i < anzahlBuchstaben; i++)
{
umgetret[i] = buchstabenfolge[anzahlBuchstaben - 1 -i];
}
for (int i = 0; i < anzahlBuchstaben; i++)
{
Debug.Log(dieBuchstabenHintereinander[i]);
}
}
// Update is called once per frame
void Update()
{
}
}