Class NSString

    • Constructor Detail

      • NSString

        protected NSString​(org.moe.natj.general.Pointer peer)
    • Method Detail

      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
      • alloc

        public static NSString alloc()
      • allocWithZone

        public static java.lang.Object allocWithZone​(org.moe.natj.general.ptr.VoidPtr zone)
      • automaticallyNotifiesObserversForKey

        public static boolean automaticallyNotifiesObserversForKey​(java.lang.String key)
      • availableStringEncodings

        public static org.moe.natj.general.ptr.ConstNUIntPtr availableStringEncodings()
      • cancelPreviousPerformRequestsWithTarget

        public static void cancelPreviousPerformRequestsWithTarget​(java.lang.Object aTarget)
      • cancelPreviousPerformRequestsWithTargetSelectorObject

        public static void cancelPreviousPerformRequestsWithTargetSelectorObject​(java.lang.Object aTarget,
                                                                                 org.moe.natj.objc.SEL aSelector,
                                                                                 java.lang.Object anArgument)
      • classFallbacksForKeyedArchiver

        public static NSArray<java.lang.String> classFallbacksForKeyedArchiver()
      • classForKeyedUnarchiver

        public static org.moe.natj.objc.Class classForKeyedUnarchiver()
      • debugDescription_static

        public static java.lang.String debugDescription_static()
      • defaultCStringEncoding

        public static long defaultCStringEncoding()
        Should be rarely used
      • instanceMethodSignatureForSelector

        public static NSMethodSignature instanceMethodSignatureForSelector​(org.moe.natj.objc.SEL aSelector)
      • instancesRespondToSelector

        public static boolean instancesRespondToSelector​(org.moe.natj.objc.SEL aSelector)
      • isSubclassOfClass

        public static boolean isSubclassOfClass​(org.moe.natj.objc.Class aClass)
      • keyPathsForValuesAffectingValueForKey

        public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey​(java.lang.String key)
      • localizedNameOfStringEncoding

        public static java.lang.String localizedNameOfStringEncoding​(long encoding)
      • localizedStringWithFormat

        public static java.lang.Object localizedStringWithFormat​(java.lang.String format,
                                                                 java.lang.Object... varargs)
      • localizedUserNotificationStringForKeyArguments

        public static java.lang.String localizedUserNotificationStringForKeyArguments​(java.lang.String key,
                                                                                      NSArray<?> arguments)
        Use -[NSString localizedUserNotificationStringForKey:arguments:] to provide a string that will be localized at the time that the notification is presented.
      • new_objc

        public static java.lang.Object new_objc()
      • pathWithComponents

        public static java.lang.String pathWithComponents​(NSArray<java.lang.String> components)
      • resolveClassMethod

        public static boolean resolveClassMethod​(org.moe.natj.objc.SEL sel)
      • resolveInstanceMethod

        public static boolean resolveInstanceMethod​(org.moe.natj.objc.SEL sel)
      • setVersion_static

        public static void setVersion_static​(long aVersion)
      • string

        public static NSString string()
      • stringEncodingForDataEncodingOptionsConvertedStringUsedLossyConversion

        public static long stringEncodingForDataEncodingOptionsConvertedStringUsedLossyConversion​(NSData data,
                                                                                                  NSDictionary<java.lang.String,​?> opts,
                                                                                                  org.moe.natj.general.ptr.Ptr<NSString> string,
                                                                                                  org.moe.natj.general.ptr.BoolPtr usedLossyConversion)
        This API is used to detect the string encoding of a given raw data. It can also do lossy string conversion. It converts the data to a string in the detected string encoding. The data object contains the raw bytes, and the option dictionary contains the hints and parameters for the analysis. The opts dictionary can be nil. If the string parameter is not NULL, the string created by the detected string encoding is returned. The lossy substitution string is emitted in the output string for characters that could not be converted when lossy conversion is enabled. The usedLossyConversion indicates if there is any lossy conversion in the resulted string. If no encoding can be detected, 0 is returned. The possible items for the dictionary are: 1) an array of suggested string encodings (without specifying the 3rd option in this list, all string encodings are considered but the ones in the array will have a higher preference; moreover, the order of the encodings in the array is important: the first encoding has a higher preference than the second one in the array) 2) an array of string encodings not to use (the string encodings in this list will not be considered at all) 3) a boolean option indicating whether only the suggested string encodings are considered 4) a boolean option indicating whether lossy is allowed 5) an option that gives a specific string to substitude for mystery bytes 6) the current user's language 7) a boolean option indicating whether the data is generated by Windows If the values in the dictionary have wrong types (for example, the value of NSStringEncodingDetectionSuggestedEncodingsKey is not an array), an exception is thrown. If the values in the dictionary are unknown (for example, the value in the array of suggested string encodings is not a valid encoding), the values will be ignored.
      • stringWithCString

        @Deprecated
        public static NSString stringWithCString​(org.moe.natj.general.ptr.ConstBytePtr bytes)
        Deprecated.
      • stringWithCStringEncoding

        public static NSString stringWithCStringEncoding​(org.moe.natj.general.ptr.ConstBytePtr cString,
                                                         long enc)
      • stringWithCStringLength

        @Deprecated
        public static NSString stringWithCStringLength​(org.moe.natj.general.ptr.ConstBytePtr bytes,
                                                       long length)
        Deprecated.
      • stringWithCharactersLength

        public static NSString stringWithCharactersLength​(org.moe.natj.general.ptr.ConstCharPtr characters,
                                                          long length)
      • stringWithContentsOfFile

        @Deprecated
        public static NSString stringWithContentsOfFile​(java.lang.String path)
        Deprecated.
      • stringWithContentsOfFileEncodingError

        public static NSString stringWithContentsOfFileEncodingError​(java.lang.String path,
                                                                     long enc,
                                                                     org.moe.natj.general.ptr.Ptr<NSError> error)
      • stringWithContentsOfFileUsedEncodingError

        public static NSString stringWithContentsOfFileUsedEncodingError​(java.lang.String path,
                                                                         org.moe.natj.general.ptr.NUIntPtr enc,
                                                                         org.moe.natj.general.ptr.Ptr<NSError> error)
      • stringWithContentsOfURL

        @Deprecated
        public static NSString stringWithContentsOfURL​(NSURL url)
        Deprecated.
      • stringWithContentsOfURLEncodingError

        public static NSString stringWithContentsOfURLEncodingError​(NSURL url,
                                                                    long enc,
                                                                    org.moe.natj.general.ptr.Ptr<NSError> error)
      • stringWithContentsOfURLUsedEncodingError

        public static NSString stringWithContentsOfURLUsedEncodingError​(NSURL url,
                                                                        org.moe.natj.general.ptr.NUIntPtr enc,
                                                                        org.moe.natj.general.ptr.Ptr<NSError> error)
      • stringWithFormat

        public static NSString stringWithFormat​(java.lang.String format,
                                                java.lang.Object... varargs)
      • stringWithString

        public static NSString stringWithString​(java.lang.String string)
      • stringWithUTF8String

        public static NSString stringWithUTF8String​(org.moe.natj.general.ptr.ConstBytePtr nullTerminatedCString)
      • superclass_static

        public static org.moe.natj.objc.Class superclass_static()
      • supportsSecureCoding

        public static boolean supportsSecureCoding()
      • version_static

        public static long version_static()
      • UTF8String

        public org.moe.natj.general.ptr.ConstBytePtr UTF8String()
        Convenience to return null-terminated UTF8 representation
      • boolValue

        public boolean boolValue()
        Skips initial space characters (whitespaceSet), or optional -/+ sign followed by zeroes. Returns YES on encountering one of "Y", "y", "T", "t", or a digit 1-9. It ignores any trailing characters.
      • cString

        @Deprecated
        public org.moe.natj.general.ptr.ConstBytePtr cString()
        Deprecated.
        The following methods are deprecated and will be removed from this header file in the near future. These methods use NSString.defaultCStringEncoding as the encoding to convert to, which means the results depend on the user's language and potentially other settings. This might be appropriate in some cases, but often these methods are misused, resulting in issues when running in languages other then English. UTF8String in general is a much better choice when converting arbitrary NSStrings into 8-bit representations. Additional potential replacement methods are being introduced in NSString as appropriate.
      • cStringLength

        @Deprecated
        public long cStringLength()
        Deprecated.
      • cStringUsingEncoding

        public org.moe.natj.general.ptr.ConstBytePtr cStringUsingEncoding​(long encoding)
        "Autoreleased"; NULL return if encoding conversion not possible; for performance reasons, lifetime of this should not be considered longer than the lifetime of the receiving string (if the receiver string is freed, this might go invalid then, before the end of the autorelease scope). Use only with 8-bit encodings, and not encodings such as UTF-16 or UTF-32.
      • canBeConvertedToEncoding

        public boolean canBeConvertedToEncoding​(long encoding)
      • capitalizedString

        public java.lang.String capitalizedString()
      • capitalizedStringWithLocale

        public java.lang.String capitalizedStringWithLocale​(NSLocale locale)
      • caseInsensitiveCompare

        public long caseInsensitiveCompare​(java.lang.String string)
      • characterAtIndex

        public char characterAtIndex​(long index)
      • commonPrefixWithStringOptions

        public java.lang.String commonPrefixWithStringOptions​(java.lang.String str,
                                                              long mask)
      • compare

        public long compare​(java.lang.String string)
        In the compare: methods, the range argument specifies the subrange, rather than the whole, of the receiver to use in the comparison. The range is not applied to the search string. For example, [@"AB" compare:@"ABC" options:0 range:NSMakeRange(0,1)] compares "A" to "ABC", not "A" to "A", and will return NSOrderedAscending. It is an error to specify a range that is outside of the receiver's bounds, and an exception may be raised.
      • compareOptions

        public long compareOptions​(java.lang.String string,
                                   long mask)
      • compareOptionsRange

        public long compareOptionsRange​(java.lang.String string,
                                        long mask,
                                        NSRange rangeOfReceiverToCompare)
      • compareOptionsRangeLocale

        public long compareOptionsRangeLocale​(java.lang.String string,
                                              long mask,
                                              NSRange rangeOfReceiverToCompare,
                                              java.lang.Object locale)
        locale arg used to be a dictionary pre-Leopard. We now accept NSLocale. Assumes the current locale if non-nil and non-NSLocale. nil continues to mean canonical compare, which doesn't depend on user's locale choice.
      • completePathIntoStringCaseSensitiveMatchesIntoArrayFilterTypes

        public long completePathIntoStringCaseSensitiveMatchesIntoArrayFilterTypes​(org.moe.natj.general.ptr.Ptr<NSString> outputName,
                                                                                   boolean flag,
                                                                                   org.moe.natj.general.ptr.Ptr<NSArray<java.lang.String>> outputArray,
                                                                                   NSArray<java.lang.String> filterTypes)
      • componentsSeparatedByCharactersInSet

        public NSArray<java.lang.String> componentsSeparatedByCharactersInSet​(NSCharacterSet separator)
      • componentsSeparatedByString

        public NSArray<java.lang.String> componentsSeparatedByString​(java.lang.String separator)
      • containsString

        public boolean containsString​(java.lang.String str)
        Simple convenience methods for string searching. containsString: returns YES if the target string is contained within the receiver. Same as calling rangeOfString:options: with no options, thus doing a case-sensitive, locale-unaware search. localizedCaseInsensitiveContainsString: is the case-insensitive variant which also takes the current locale into effect. Starting in 10.11 and iOS9, the new localizedStandardRangeOfString: or localizedStandardContainsString: APIs are even better convenience methods for user level searching. More sophisticated needs can be achieved by calling rangeOfString:options:range:locale: directly.
      • copyWithZone

        public java.lang.Object copyWithZone​(org.moe.natj.general.ptr.VoidPtr zone)
        Specified by:
        copyWithZone in interface NSCopying
      • dataUsingEncoding

        public NSData dataUsingEncoding​(long encoding)
        External representation
      • dataUsingEncodingAllowLossyConversion

        public NSData dataUsingEncodingAllowLossyConversion​(long encoding,
                                                            boolean lossy)
        External representation
      • decomposedStringWithCanonicalMapping

        public java.lang.String decomposedStringWithCanonicalMapping()
      • decomposedStringWithCompatibilityMapping

        public java.lang.String decomposedStringWithCompatibilityMapping()
      • doubleValue

        public double doubleValue()
        The following convenience methods all skip initial space characters (whitespaceSet) and ignore trailing characters. They are not locale-aware. NSScanner or NSNumberFormatter can be used for more powerful and locale-aware parsing of numbers.
      • drawAtPointForWidthWithFontFontSizeLineBreakModeBaselineAdjustment

        @Deprecated
        public CGSize drawAtPointForWidthWithFontFontSizeLineBreakModeBaselineAdjustment​(CGPoint point,
                                                                                         double width,
                                                                                         UIFont font,
                                                                                         double fontSize,
                                                                                         long lineBreakMode,
                                                                                         long baselineAdjustment)
        Deprecated.
      • drawAtPointForWidthWithFontLineBreakMode

        @Deprecated
        public CGSize drawAtPointForWidthWithFontLineBreakMode​(CGPoint point,
                                                               double width,
                                                               UIFont font,
                                                               long lineBreakMode)
        Deprecated.
      • drawAtPointForWidthWithFontMinFontSizeActualFontSizeLineBreakModeBaselineAdjustment

        @Deprecated
        public CGSize drawAtPointForWidthWithFontMinFontSizeActualFontSizeLineBreakModeBaselineAdjustment​(CGPoint point,
                                                                                                          double width,
                                                                                                          UIFont font,
                                                                                                          double minFontSize,
                                                                                                          org.moe.natj.general.ptr.NFloatPtr actualFontSize,
                                                                                                          long lineBreakMode,
                                                                                                          long baselineAdjustment)
        Deprecated.
      • drawAtPointWithAttributes

        public void drawAtPointWithAttributes​(CGPoint point,
                                              NSDictionary<java.lang.String,​?> attrs)
      • drawAtPointWithFont

        @Deprecated
        public CGSize drawAtPointWithFont​(CGPoint point,
                                          UIFont font)
        Deprecated.
        Single line, no wrapping. Truncation based on the NSLineBreakMode.
      • drawInRectWithAttributes

        public void drawInRectWithAttributes​(CGRect rect,
                                             NSDictionary<java.lang.String,​?> attrs)
      • drawInRectWithFont

        @Deprecated
        public CGSize drawInRectWithFont​(CGRect rect,
                                         UIFont font)
        Deprecated.
        Wrapping to fit horizontal and vertical size.
      • drawInRectWithFontLineBreakMode

        @Deprecated
        public CGSize drawInRectWithFontLineBreakMode​(CGRect rect,
                                                      UIFont font,
                                                      long lineBreakMode)
        Deprecated.
      • drawInRectWithFontLineBreakModeAlignment

        @Deprecated
        public CGSize drawInRectWithFontLineBreakModeAlignment​(CGRect rect,
                                                               UIFont font,
                                                               long lineBreakMode,
                                                               long alignment)
        Deprecated.
      • drawWithRectOptionsAttributesContext

        public void drawWithRectOptionsAttributesContext​(CGRect rect,
                                                         long options,
                                                         NSDictionary<java.lang.String,​?> attributes,
                                                         NSStringDrawingContext context)
      • enumerateSubstringsInRangeOptionsUsingBlock

        public void enumerateSubstringsInRangeOptionsUsingBlock​(NSRange range,
                                                                long opts,
                                                                NSString.Block_enumerateSubstringsInRangeOptionsUsingBlock block)
        In the enumerate methods, the blocks will be invoked inside an autorelease pool, so any values assigned inside the block should be retained.
      • fastestEncoding

        public long fastestEncoding()
        Result in O(1) time; a rough estimate
      • fileSystemRepresentation

        public java.lang.String fileSystemRepresentation()
      • floatValue

        public float floatValue()
      • getBytesMaxLengthUsedLengthEncodingOptionsRangeRemainingRange

        public boolean getBytesMaxLengthUsedLengthEncodingOptionsRangeRemainingRange​(org.moe.natj.general.ptr.VoidPtr buffer,
                                                                                     long maxBufferCount,
                                                                                     org.moe.natj.general.ptr.NUIntPtr usedBufferCount,
                                                                                     long encoding,
                                                                                     long options,
                                                                                     NSRange range,
                                                                                     NSRange leftover)
        Use this to convert string section at a time into a fixed-size buffer, without any allocations. Does not NULL-terminate. buffer is the buffer to write to; if NULL, this method can be used to computed size of needed buffer. maxBufferCount is the length of the buffer in bytes. It's a good idea to make sure this is at least enough to hold one character's worth of conversion. usedBufferCount is the length of the buffer used up by the current conversion. Can be NULL. encoding is the encoding to convert to. options specifies the options to apply. range is the range to convert. leftOver is the remaining range. Can be NULL. YES return indicates some characters were converted. Conversion might usually stop when the buffer fills, but it might also stop when the conversion isn't possible due to the chosen encoding.
      • getCString

        @Deprecated
        public void getCString​(org.moe.natj.general.ptr.BytePtr bytes)
        Deprecated.
      • getCStringMaxLength

        @Deprecated
        public void getCStringMaxLength​(org.moe.natj.general.ptr.BytePtr bytes,
                                        long maxLength)
        Deprecated.
      • getCStringMaxLengthEncoding

        public boolean getCStringMaxLengthEncoding​(org.moe.natj.general.ptr.BytePtr buffer,
                                                   long maxBufferCount,
                                                   long encoding)
        NO return if conversion not possible due to encoding errors or too small of a buffer. The buffer should include room for maxBufferCount bytes; this number should accomodate the expected size of the return value plus the NULL termination character, which this method adds. (So note that the maxLength passed to this method is one more than the one you would have passed to the deprecated getCString:maxLength:.) Use only with 8-bit encodings, and not encodings such as UTF-16 or UTF-32.
      • getCStringMaxLengthRangeRemainingRange

        @Deprecated
        public void getCStringMaxLengthRangeRemainingRange​(org.moe.natj.general.ptr.BytePtr bytes,
                                                           long maxLength,
                                                           NSRange aRange,
                                                           NSRange leftoverRange)
        Deprecated.
      • getCharacters

        public void getCharacters​(org.moe.natj.general.ptr.CharPtr buffer)
        This method is unsafe because it could potentially cause buffer overruns. You should use -getCharacters:range: instead.
      • getCharactersRange

        public void getCharactersRange​(org.moe.natj.general.ptr.CharPtr buffer,
                                       NSRange range)
        Use with rangeOfComposedCharacterSequencesForRange: to avoid breaking up character sequences
      • getFileSystemRepresentationMaxLength

        public boolean getFileSystemRepresentationMaxLength​(org.moe.natj.general.ptr.BytePtr cname,
                                                            long max)
      • getLineStartEndContentsEndForRange

        public void getLineStartEndContentsEndForRange​(org.moe.natj.general.ptr.NUIntPtr startPtr,
                                                       org.moe.natj.general.ptr.NUIntPtr lineEndPtr,
                                                       org.moe.natj.general.ptr.NUIntPtr contentsEndPtr,
                                                       NSRange range)
      • getParagraphStartEndContentsEndForRange

        public void getParagraphStartEndContentsEndForRange​(org.moe.natj.general.ptr.NUIntPtr startPtr,
                                                            org.moe.natj.general.ptr.NUIntPtr parEndPtr,
                                                            org.moe.natj.general.ptr.NUIntPtr contentsEndPtr,
                                                            NSRange range)
      • hasPrefix

        public boolean hasPrefix​(java.lang.String str)
        These perform locale unaware prefix or suffix match. If you need locale awareness, use rangeOfString:options:range:locale:, passing NSAnchoredSearch (or'ed with NSBackwardsSearch for suffix, and NSCaseInsensitiveSearch|NSDiacriticInsensitiveSearch if needed) for options, NSMakeRange(0, [receiver length]) for range, and [NSLocale currentLocale] for locale.
      • hasSuffix

        public boolean hasSuffix​(java.lang.String str)
      • init

        public NSString init()
        The initializers available to subclasses. See further below for additional init methods.
        Overrides:
        init in class NSObject
      • initWithBytesLengthEncoding

        public NSString initWithBytesLengthEncoding​(org.moe.natj.general.ptr.ConstVoidPtr bytes,
                                                    long len,
                                                    long encoding)
      • initWithBytesNoCopyLengthEncodingFreeWhenDone

        public NSString initWithBytesNoCopyLengthEncodingFreeWhenDone​(org.moe.natj.general.ptr.VoidPtr bytes,
                                                                      long len,
                                                                      long encoding,
                                                                      boolean freeBuffer)
        "NoCopy" is a hint
      • initWithCString

        @Deprecated
        public NSString initWithCString​(org.moe.natj.general.ptr.ConstBytePtr bytes)
        Deprecated.
      • initWithCStringEncoding

        public NSString initWithCStringEncoding​(org.moe.natj.general.ptr.ConstBytePtr nullTerminatedCString,
                                                long encoding)
      • initWithCStringLength

        @Deprecated
        public NSString initWithCStringLength​(org.moe.natj.general.ptr.ConstBytePtr bytes,
                                              long length)
        Deprecated.
      • initWithCStringNoCopyLengthFreeWhenDone

        @Deprecated
        public NSString initWithCStringNoCopyLengthFreeWhenDone​(org.moe.natj.general.ptr.BytePtr bytes,
                                                                long length,
                                                                boolean freeBuffer)
        Deprecated.
      • initWithCharactersLength

        public NSString initWithCharactersLength​(org.moe.natj.general.ptr.ConstCharPtr characters,
                                                 long length)
      • initWithCharactersNoCopyLengthFreeWhenDone

        public NSString initWithCharactersNoCopyLengthFreeWhenDone​(org.moe.natj.general.ptr.CharPtr characters,
                                                                   long length,
                                                                   boolean freeBuffer)
        "NoCopy" is a hint
      • initWithContentsOfFile

        @Deprecated
        public NSString initWithContentsOfFile​(java.lang.String path)
        Deprecated.
      • initWithContentsOfFileEncodingError

        public NSString initWithContentsOfFileEncodingError​(java.lang.String path,
                                                            long enc,
                                                            org.moe.natj.general.ptr.Ptr<NSError> error)
      • initWithContentsOfFileUsedEncodingError

        public NSString initWithContentsOfFileUsedEncodingError​(java.lang.String path,
                                                                org.moe.natj.general.ptr.NUIntPtr enc,
                                                                org.moe.natj.general.ptr.Ptr<NSError> error)
      • initWithContentsOfURL

        @Deprecated
        public NSString initWithContentsOfURL​(NSURL url)
        Deprecated.
      • initWithContentsOfURLEncodingError

        public NSString initWithContentsOfURLEncodingError​(NSURL url,
                                                           long enc,
                                                           org.moe.natj.general.ptr.Ptr<NSError> error)
        These use the specified encoding. If nil is returned, the optional error return indicates problem that was encountered (for instance, file system or encoding errors).
      • initWithContentsOfURLUsedEncodingError

        public NSString initWithContentsOfURLUsedEncodingError​(NSURL url,
                                                               org.moe.natj.general.ptr.NUIntPtr enc,
                                                               org.moe.natj.general.ptr.Ptr<NSError> error)
        These try to determine the encoding, and return the encoding which was used. Note that these methods might get "smarter" in subsequent releases of the system, and use additional techniques for recognizing encodings. If nil is returned, the optional error return indicates problem that was encountered (for instance, file system or encoding errors).
      • initWithDataEncoding

        public NSString initWithDataEncoding​(NSData data,
                                             long encoding)
      • initWithFormat

        public NSString initWithFormat​(java.lang.String format,
                                       java.lang.Object... varargs)
      • initWithFormatArguments

        public NSString initWithFormatArguments​(java.lang.String format,
                                                org.moe.natj.general.ptr.BytePtr argList)
      • initWithFormatLocale

        public NSString initWithFormatLocale​(java.lang.String format,
                                             java.lang.Object locale,
                                             java.lang.Object... varargs)
      • initWithFormatLocaleArguments

        public NSString initWithFormatLocaleArguments​(java.lang.String format,
                                                      java.lang.Object locale,
                                                      org.moe.natj.general.ptr.BytePtr argList)
      • initWithString

        public NSString initWithString​(java.lang.String aString)
      • initWithUTF8String

        public NSString initWithUTF8String​(org.moe.natj.general.ptr.ConstBytePtr nullTerminatedCString)
      • intValue

        public int intValue()
      • integerValue

        public long integerValue()
      • isAbsolutePath

        public boolean isAbsolutePath()
      • isEqualToString

        public boolean isEqualToString​(java.lang.String aString)
      • lastPathComponent

        public java.lang.String lastPathComponent()
      • length

        public long length()
        NSString primitives. A minimal subclass of NSString just needs to implement these two, along with an init method appropriate for that subclass. We also recommend overriding getCharacters:range: for performance.
      • lengthOfBytesUsingEncoding

        public long lengthOfBytesUsingEncoding​(long enc)
        Result in O(n) time; the result is exact. Returns 0 on error (cannot convert to specified encoding, or overflow)
      • lineRangeForRange

        public NSRange lineRangeForRange​(NSRange range)
      • linguisticTagsInRangeSchemeOptionsOrthographyTokenRanges

        public NSArray<java.lang.String> linguisticTagsInRangeSchemeOptionsOrthographyTokenRanges​(NSRange range,
                                                                                                  java.lang.String scheme,
                                                                                                  long options,
                                                                                                  NSOrthography orthography,
                                                                                                  org.moe.natj.general.ptr.Ptr<NSArray<? extends NSValue>> tokenRanges)
        Clients wishing to analyze a given string once may use these NSString APIs without having to create an instance of NSLinguisticTagger. If more than one tagging operation is needed on a given string, it is more efficient to use an explicit NSLinguisticTagger instance.
      • localizedCapitalizedString

        public java.lang.String localizedCapitalizedString()
      • localizedCaseInsensitiveCompare

        public long localizedCaseInsensitiveCompare​(java.lang.String string)
      • localizedCaseInsensitiveContainsString

        public boolean localizedCaseInsensitiveContainsString​(java.lang.String str)
      • localizedCompare

        public long localizedCompare​(java.lang.String string)
      • localizedLowercaseString

        public java.lang.String localizedLowercaseString()
      • localizedStandardCompare

        public long localizedStandardCompare​(java.lang.String string)
        localizedStandardCompare:, added in 10.6, should be used whenever file names or other strings are presented in lists and tables where Finder-like sorting is appropriate. The exact behavior of this method may be tweaked in future releases, and will be different under different localizations, so clients should not depend on the exact sorting order of the strings.
      • localizedStandardContainsString

        public boolean localizedStandardContainsString​(java.lang.String str)
        The following two are the most appropriate methods for doing user-level string searches, similar to how searches are done generally in the system. The search is locale-aware, case and diacritic insensitive. As with other APIs, "standard" in the name implies "system default behavior," so the exact list of search options applied may change over time. If you need more control over the search options, please use the rangeOfString:options:range:locale: method. You can pass [NSLocale currentLocale] for searches in user's locale.
      • localizedStandardRangeOfString

        public NSRange localizedStandardRangeOfString​(java.lang.String str)
      • localizedUppercaseString

        public java.lang.String localizedUppercaseString()
        The following three return the locale-aware case mappings. They are suitable for strings presented to the user.
      • longLongValue

        public long longLongValue()
      • lossyCString

        @Deprecated
        public org.moe.natj.general.ptr.ConstBytePtr lossyCString()
        Deprecated.
      • lowercaseString

        public java.lang.String lowercaseString()
      • lowercaseStringWithLocale

        public java.lang.String lowercaseStringWithLocale​(NSLocale locale)
      • maximumLengthOfBytesUsingEncoding

        public long maximumLengthOfBytesUsingEncoding​(long enc)
        Result in O(1) time; the estimate may be way over what's needed. Returns 0 on error (overflow)
      • mutableCopyWithZone

        public java.lang.Object mutableCopyWithZone​(org.moe.natj.general.ptr.VoidPtr zone)
        Specified by:
        mutableCopyWithZone in interface NSMutableCopying
      • paragraphRangeForRange

        public NSRange paragraphRangeForRange​(NSRange range)
      • pathComponents

        public NSArray<java.lang.String> pathComponents()
      • pathExtension

        public java.lang.String pathExtension()
      • precomposedStringWithCanonicalMapping

        public java.lang.String precomposedStringWithCanonicalMapping()
      • precomposedStringWithCompatibilityMapping

        public java.lang.String precomposedStringWithCompatibilityMapping()
      • propertyList

        public java.lang.Object propertyList()
        These methods are no longer recommended since they do not work with property lists and strings files in binary plist format. Please use the APIs in NSPropertyList.h instead.
      • propertyListFromStringsFileFormat

        public NSDictionary<?,​?> propertyListFromStringsFileFormat()
      • rangeOfCharacterFromSet

        public NSRange rangeOfCharacterFromSet​(NSCharacterSet searchSet)
        These return the range of the first character from the set in the string, not the range of a sequence of characters. The range argument specifies the subrange, rather than the whole, of the receiver to use in the search. It is an error to specify a range that is outside of the receiver's bounds, and an exception may be raised.
      • rangeOfCharacterFromSetOptions

        public NSRange rangeOfCharacterFromSetOptions​(NSCharacterSet searchSet,
                                                      long mask)
      • rangeOfCharacterFromSetOptionsRange

        public NSRange rangeOfCharacterFromSetOptionsRange​(NSCharacterSet searchSet,
                                                           long mask,
                                                           NSRange rangeOfReceiverToSearch)
      • rangeOfComposedCharacterSequenceAtIndex

        public NSRange rangeOfComposedCharacterSequenceAtIndex​(long index)
      • rangeOfComposedCharacterSequencesForRange

        public NSRange rangeOfComposedCharacterSequencesForRange​(NSRange range)
      • rangeOfString

        public NSRange rangeOfString​(java.lang.String searchString)
        These methods perform string search, looking for the searchString within the receiver string. These return length==0 if the target string is not found. So, to check for containment: ([str rangeOfString:@"target"].length > 0). Note that the length of the range returned by these methods might be different than the length of the target string, due composed characters and such. Note that the first three methods do not take locale arguments, and perform the search in a non-locale aware fashion, which is not appropriate for user-level searching. To do user-level string searching, use the last method, specifying locale:[NSLocale currentLocale], or better yet, use localizedStandardRangeOfString: or localizedStandardContainsString:. The range argument specifies the subrange, rather than the whole, of the receiver to use in the search. It is an error to specify a range that is outside of the receiver's bounds, and an exception may be raised.
      • rangeOfStringOptions

        public NSRange rangeOfStringOptions​(java.lang.String searchString,
                                            long mask)
      • rangeOfStringOptionsRange

        public NSRange rangeOfStringOptionsRange​(java.lang.String searchString,
                                                 long mask,
                                                 NSRange rangeOfReceiverToSearch)
      • rangeOfStringOptionsRangeLocale

        public NSRange rangeOfStringOptionsRangeLocale​(java.lang.String searchString,
                                                       long mask,
                                                       NSRange rangeOfReceiverToSearch,
                                                       NSLocale locale)
      • sizeWithAttributes

        public CGSize sizeWithAttributes​(NSDictionary<java.lang.String,​?> attrs)
      • sizeWithFont

        @Deprecated
        public CGSize sizeWithFont​(UIFont font)
        Deprecated.
        Single line, no wrapping. Truncation based on the NSLineBreakMode.
      • sizeWithFontConstrainedToSize

        @Deprecated
        public CGSize sizeWithFontConstrainedToSize​(UIFont font,
                                                    CGSize size)
        Deprecated.
        Uses NSLineBreakModeWordWrap
      • sizeWithFontConstrainedToSizeLineBreakMode

        @Deprecated
        public CGSize sizeWithFontConstrainedToSizeLineBreakMode​(UIFont font,
                                                                 CGSize size,
                                                                 long lineBreakMode)
        Deprecated.
        NSTextAlignment is not needed to determine size
      • sizeWithFontForWidthLineBreakMode

        @Deprecated
        public CGSize sizeWithFontForWidthLineBreakMode​(UIFont font,
                                                        double width,
                                                        long lineBreakMode)
        Deprecated.
      • sizeWithFontMinFontSizeActualFontSizeForWidthLineBreakMode

        @Deprecated
        public CGSize sizeWithFontMinFontSizeActualFontSizeForWidthLineBreakMode​(UIFont font,
                                                                                 double minFontSize,
                                                                                 org.moe.natj.general.ptr.NFloatPtr actualFontSize,
                                                                                 double width,
                                                                                 long lineBreakMode)
        Deprecated.
        These methods will behave identically to the above single line methods if the string will fit in the specified width in the specified font. If not, the font size will be reduced until either the string fits or the minimum font size is reached. If the minimum font size is reached and the string still won't fit, the string will be truncated and drawn at the minimum font size. The first two methods are used together, and the actualFontSize returned in the sizeWithFont method should be passed to the drawAtPoint method. The last method will do the sizing calculation and drawing in one operation.
      • smallestEncoding

        public long smallestEncoding()
        Result in O(n) time; the encoding in which the string is most compact
      • stringByAbbreviatingWithTildeInPath

        public java.lang.String stringByAbbreviatingWithTildeInPath()
      • stringByAddingPercentEncodingWithAllowedCharacters

        public java.lang.String stringByAddingPercentEncodingWithAllowedCharacters​(NSCharacterSet allowedCharacters)
        Returns a new string made from the receiver by replacing all characters not in the allowedCharacters set with percent encoded characters. UTF-8 encoding is used to determine the correct percent encoded characters. Entire URL strings cannot be percent-encoded. This method is intended to percent-encode an URL component or subcomponent string, NOT the entire URL string. Any characters in allowedCharacters outside of the 7-bit ASCII range are ignored.
      • stringByAddingPercentEscapesUsingEncoding

        @Deprecated
        public java.lang.String stringByAddingPercentEscapesUsingEncoding​(long enc)
        Deprecated.
      • stringByAppendingFormat

        public java.lang.String stringByAppendingFormat​(java.lang.String format,
                                                        java.lang.Object... varargs)
      • stringByAppendingPathComponent

        public java.lang.String stringByAppendingPathComponent​(java.lang.String str)
      • stringByAppendingPathExtension

        public java.lang.String stringByAppendingPathExtension​(java.lang.String str)
      • stringByAppendingString

        public java.lang.String stringByAppendingString​(java.lang.String aString)
      • stringByApplyingTransformReverse

        public java.lang.String stringByApplyingTransformReverse​(java.lang.String transform,
                                                                 boolean reverse)
        Returns nil if reverse not applicable or transform is invalid
      • stringByDeletingLastPathComponent

        public java.lang.String stringByDeletingLastPathComponent()
      • stringByDeletingPathExtension

        public java.lang.String stringByDeletingPathExtension()
      • stringByExpandingTildeInPath

        public java.lang.String stringByExpandingTildeInPath()
      • stringByFoldingWithOptionsLocale

        public java.lang.String stringByFoldingWithOptionsLocale​(long options,
                                                                 NSLocale locale)
        Returns a string with the character folding options applied. theOptions is a mask of compare flags with *InsensitiveSearch suffix.
      • stringByPaddingToLengthWithStringStartingAtIndex

        public java.lang.String stringByPaddingToLengthWithStringStartingAtIndex​(long newLength,
                                                                                 java.lang.String padString,
                                                                                 long padIndex)
      • stringByRemovingPercentEncoding

        public java.lang.String stringByRemovingPercentEncoding()
        Returns a new string made from the receiver by replacing all percent encoded sequences with the matching UTF-8 characters.
      • stringByReplacingCharactersInRangeWithString

        public java.lang.String stringByReplacingCharactersInRangeWithString​(NSRange range,
                                                                             java.lang.String replacement)
        Replace characters in range with the specified string, returning new string.
      • stringByReplacingOccurrencesOfStringWithString

        public java.lang.String stringByReplacingOccurrencesOfStringWithString​(java.lang.String target,
                                                                               java.lang.String replacement)
        Replace all occurrences of the target string with replacement. Invokes the above method with 0 options and range of the whole string.
      • stringByReplacingOccurrencesOfStringWithStringOptionsRange

        public java.lang.String stringByReplacingOccurrencesOfStringWithStringOptionsRange​(java.lang.String target,
                                                                                           java.lang.String replacement,
                                                                                           long options,
                                                                                           NSRange searchRange)
        Replace all occurrences of the target string in the specified range with replacement. Specified compare options are used for matching target. If NSRegularExpressionSearch is specified, the replacement is treated as a template, as in the corresponding NSRegularExpression methods, and no other options can apply except NSCaseInsensitiveSearch and NSAnchoredSearch.
      • stringByReplacingPercentEscapesUsingEncoding

        @Deprecated
        public java.lang.String stringByReplacingPercentEscapesUsingEncoding​(long enc)
        Deprecated.
      • stringByResolvingSymlinksInPath

        public java.lang.String stringByResolvingSymlinksInPath()
      • stringByStandardizingPath

        public java.lang.String stringByStandardizingPath()
      • stringByTrimmingCharactersInSet

        public java.lang.String stringByTrimmingCharactersInSet​(NSCharacterSet set)
      • stringsByAppendingPaths

        public NSArray<java.lang.String> stringsByAppendingPaths​(NSArray<java.lang.String> paths)
      • substringFromIndex

        public java.lang.String substringFromIndex​(long from)
        To avoid breaking up character sequences such as Emoji, you can do: [str substringFromIndex:[str rangeOfComposedCharacterSequenceAtIndex:index].location] [str substringToIndex:NSMaxRange([str rangeOfComposedCharacterSequenceAtIndex:index])] [str substringWithRange:[str rangeOfComposedCharacterSequencesForRange:range]
      • substringToIndex

        public java.lang.String substringToIndex​(long to)
      • substringWithRange

        public java.lang.String substringWithRange​(NSRange range)
        Use with rangeOfComposedCharacterSequencesForRange: to avoid breaking up character sequences
      • _supportsSecureCoding

        public boolean _supportsSecureCoding()
        Description copied from interface: NSSecureCoding
        This property must return YES on all classes that allow secure coding. Subclasses of classes that adopt NSSecureCoding and override initWithCoder: must also override this method and return YES. The Secure Coding Guide should be consulted when writing methods that decode data.
        Specified by:
        _supportsSecureCoding in interface NSSecureCoding
      • uppercaseString

        public java.lang.String uppercaseString()
        The following three return the canonical (non-localized) mappings. They are suitable for programming operations that require stable results not depending on the user's locale preference. For locale-aware case mapping for strings presented to users, use the "localized" methods below.
      • uppercaseStringWithLocale

        public java.lang.String uppercaseStringWithLocale​(NSLocale locale)
        The following methods perform localized case mappings based on the locale specified. Passing nil indicates the canonical mapping. For the user preference locale setting, specify +[NSLocale currentLocale].
      • variantFittingPresentationWidth

        public java.lang.String variantFittingPresentationWidth​(long width)
        For strings with length variations, such as from a stringsdict file, this method returns the variant at the given width. If there is no variant at the given width, the one for the next smaller width is returned. And if there are none smaller, the smallest available is returned. For strings without variations, this method returns self. The unit that width is expressed in is decided by the application or framework. But it is intended to be some measurement indicative of the context a string would fit best to avoid truncation and wasted space.
      • writeToFileAtomically

        @Deprecated
        public boolean writeToFileAtomically​(java.lang.String path,
                                             boolean useAuxiliaryFile)
        Deprecated.
      • writeToFileAtomicallyEncodingError

        public boolean writeToFileAtomicallyEncodingError​(java.lang.String path,
                                                          boolean useAuxiliaryFile,
                                                          long enc,
                                                          org.moe.natj.general.ptr.Ptr<NSError> error)
      • writeToURLAtomically

        @Deprecated
        public boolean writeToURLAtomically​(NSURL url,
                                            boolean atomically)
        Deprecated.
      • writeToURLAtomicallyEncodingError

        public boolean writeToURLAtomicallyEncodingError​(NSURL url,
                                                         boolean useAuxiliaryFile,
                                                         long enc,
                                                         org.moe.natj.general.ptr.Ptr<NSError> error)
        Write to specified url or path using the specified encoding. The optional error return is to indicate file system or encoding errors.
      • itemProviderVisibilityForRepresentationWithTypeIdentifier_static

        public static long itemProviderVisibilityForRepresentationWithTypeIdentifier_static​(java.lang.String typeIdentifier)
      • itemProviderVisibilityForRepresentationWithTypeIdentifier

        public long itemProviderVisibilityForRepresentationWithTypeIdentifier​(java.lang.String typeIdentifier)
      • objectWithItemProviderDataTypeIdentifierError

        public static java.lang.Object objectWithItemProviderDataTypeIdentifierError​(NSData data,
                                                                                     java.lang.String typeIdentifier,
                                                                                     org.moe.natj.general.ptr.Ptr<NSError> outError)
      • readableTypeIdentifiersForItemProvider

        public static NSArray<java.lang.String> readableTypeIdentifiersForItemProvider()
      • writableTypeIdentifiersForItemProvider_static

        public static NSArray<java.lang.String> writableTypeIdentifiersForItemProvider_static()
      • writableTypeIdentifiersForItemProvider

        public NSArray<java.lang.String> writableTypeIdentifiersForItemProvider()
      • deferredLocalizedIntentsStringWithFormat

        public static java.lang.String deferredLocalizedIntentsStringWithFormat​(java.lang.String format,
                                                                                java.lang.Object... varargs)
        Reads the string from the Localizable.strings file in the main app's bundle
      • deferredLocalizedIntentsStringWithFormatFromTable

        public static java.lang.String deferredLocalizedIntentsStringWithFormatFromTable​(java.lang.String format,
                                                                                         java.lang.String table,
                                                                                         java.lang.Object... varargs)
        Reads the string from the provided table file in the main app's bundle
      • deferredLocalizedIntentsStringWithFormatFromTableArguments

        public static java.lang.String deferredLocalizedIntentsStringWithFormatFromTableArguments​(java.lang.String format,
                                                                                                  java.lang.String table,
                                                                                                  org.moe.natj.general.ptr.BytePtr arguments)
        Reads the string from the provided table file in the main app's bundle
      • stringByAppendingPathComponentConformingToType

        public java.lang.String stringByAppendingPathComponentConformingToType​(java.lang.String partialName,
                                                                               UTType contentType)
        \brief Generate a path component based on a partial filename and a file type, then append it to a copy of the receiver. \param partialName The partial filename that should be expanded upon, e.g. \c "readme". \param contentType The type the resulting file should conform to, e.g. \c UTTypePlainText. \result A complete file path. Using the argument examples above, this method would return a string with a last path component of \c "readme.txt". Use this method when you have partial input from a user or other source and need to produce a complete filename suitable for that input. For example, if you are downloading a file from the Internet and know its MIME type, you can use this method to ensure the correct filename extension is applied to the URL where you save the file. If \a partialName already has a path extension, and that path extension is valid for file system objects of type \a contentType, no additional extension is appended to the path component before constructing the string. For example, if the inputs are \c "puppy.jpg" and \c UTTypeImage respectively, then the resulting string will have a last path component of \c "puppy.jpg" . On the other hand, if the inputs are \c "puppy.jpg" and \c UTTypePlainText respectively, the resulting string will have a last path component of \c "puppy.jpg.txt" . If you want to ensure any existing path extension is replaced, you can use the \c stringByDeletingPathExtension property first. If the path component could not be appended, this method returns a copy of \c self .
      • stringByAppendingPathExtensionForType

        public java.lang.String stringByAppendingPathExtensionForType​(UTType contentType)
        \brief Generate a string based on a partial filename or path and a file type. \param contentType The type the resulting file should conform to, e.g. \c UTTypePlainText. \result A complete file path. Using the argument example above and assuming the receiver equals \c "readme" , this method would return \c "readme.txt". Use this method when you have partial input from a user or other source and need to produce a complete filename suitable for that input. For example, if you are downloading a file from the Internet and know its MIME type, you can use this method to ensure the correct filename extension is applied to the URL where you save the file. If the receiver already has a path extension, and that path extension is valid for file system objects of type \a contentType, no additional extension is appended to the receiver before constructing the result. For example, if the receiver equals \c "puppy.jpg" and \a contentType equals \c UTTypeImage , then the resulting string will equal \c "puppy.jpg" . On the other hand, if the inputs are \c "puppy.jpg" and \c UTTypePlainText respectively, the resulting string will equal \c "puppy.jpg.txt" . If you want to ensure any existing path extension is replaced, you can use the \c stringByDeletingPathExtension property first. If the extension could not be appended, this method returns a copy of \c self .