private static AbstractStringDataType getStringDataType(boolean unicode, int length) {
		return unicode ? new UnicodeDataType()
				: (length > 0) ? new StringDataType() : new TerminatedStringDataType();
	}
Command to create a String and optionally label it.
Ghidra/Features/Base/src/main/java/ghidra/app/cmd/data/CreateStringCmd.java