B
@DocJunior
Ich haette Polgara gefragt, aber die ist noch unterwegs. Und "kleine" buchstaben in "GROSSE" wandeln, muss ich daher allein machen
Nun, die zeichen einzelen in einer schleife abarbeiten geht natuerlich. doch ich versuche mich in c++ reinzuarbeiten, und daher auch nach moeglichkeit c++ element (wie strings) statt c-elemente zu verwenden.
@helium
danke fuer den hinweis. ich koennte natuerlich auch die stl funktion nutzen.
was ich nicht verstehe: der von mir gepostete link beschreiben ja einen geeigneten manipulator in c++ fuer strings. upcase(). ist der nicht verfuegbar?
hier mal ein auszug aus obrigem link:
z = "this string has five words"; i = split(z, words, 10, RXwhite);
sets up to 10 elements of String array words to the parts of z separated by whitespace, and returns the number of parts actually encountered (5 in this case). Here, words[0] = "this", words[1] = "string", etc. The last argument may be any of the usual. If there is no match, all of z ends up in words[0]. The words array is not dynamically created by split.
int nmatches x.gsub("l","ll")
substitutes all original occurrences of "l" with "ll", setting x to "Hellllo". The first argument may be any of the usual, including Regex. If the second argument is "" or 0, all occurrences are deleted. gsub returns the number of matches that were replaced.
z = x + y; z.del("loworl");
deletes the leftmost occurrence of "loworl" in z, setting z to "Held".
z = reverse(x)
sets z to the reverse of x, or "olleH".
z = upcase(x)
sets z to x, with all letters set to uppercase, setting z to "HELLO"
z = downcase(x)
sets z to x, with all letters set to lowercase, setting z to "hello"
z = capitalize(x)
sets z to x, with the first letter of each word set to uppercase, and all others to lowercase, setting z to "Hello"
x.reverse(), x.upcase(), x.downcase(), x.capitalize()
in-place, self-modifying versions of the above.