ftp.nice.ch/pub/next/developer/resources/classes/RCString.s.tar.gz#/chart.m

This is chart.m in view mode; [Download] [Up]

// testing of Characters category.
#import <stdio.h>
#import <stdlib.h>
#import <signal.h>
#import <fcntl.h>
#import <string.h>
#import <sys/time.h>
#import <RCString.h>

int
main(int c, char **v)
{
	RCString *oString;

	oString = [RCString newFromString:v[1]];
	if (oString) {
		int first = [oString indexOfCharacter:*v[2]];
		int last =  [oString lastIndexOfCharacter:*v[2]];

		printf("first index of %c in \"%s\" is %d\n", *v[2],
			[oString data], first);
		printf("last index of %c in \"%s\" is %d\n", *v[2],
			[oString data], last);

		[oString free];
	} else {
		fprintf(stderr, "newFromString: failure\n");
		return(1);
	}
	return(0);
}

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.