Arrays übung
This commit is contained in:
@@ -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()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 6fdb9fc42e2854b4aa4f195eb9e04e70
|
||||||
Reference in New Issue
Block a user