Changes made in Rochester. See ChangeLog

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1650 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
mccallum 1996-07-15 18:41:44 +00:00
parent 7170d35e46
commit fe624212e5
55 changed files with 935 additions and 342 deletions

View file

@ -6,9 +6,12 @@
void
print_string(NSString* s)
{
printf("The string [%s], length %d\n", [s cString], [s length]);
printf("The string [%s], length %d\n", [s cStringNoCopy], [s length]);
}
#include <Foundation/NSString.h>
int main()
{
id s = @"This is a test string";
@ -16,6 +19,9 @@ int main()
print_string(s);
s2 = [s copyWithZone: NS_NOZONE];
print_string(s2);
s2 = [s stringByAppendingString:@" with something added"];
print_string(s2);
@ -24,6 +30,11 @@ int main()
withString:@"changed"];
print_string(s2);
/* Test the use of the `%@' format directive. */
s2 = [NSString stringWithFormat: @"foo %@ bar",
@"test"];
print_string(s2);
#if 0
/* An example of treating a string like a Collection:
Increment each char. */