mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-29 16:01:38 +00:00
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:
parent
7170d35e46
commit
fe624212e5
55 changed files with 935 additions and 342 deletions
|
@ -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. */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue