• Manual
  • API Documentation
  • Bayat.Json.Utilities
  • StringUtils

    Show / Hide Table of Contents
    • Bayat
      • UnityThread
    • Bayat.Core
      • AddReferenceWindow
      • AddReferenceWindow.Dependency
      • AssetReferenceResolver
      • AssetReferenceResolverEditor
      • BayatEditorStyles
      • CoreAssetPostProcessor
      • EditorApplicationUtility
      • MaterialPropertiesResolver
      • MaterialPropertiesResolverEditor
      • ReferenceCheckerWindow
      • ReferenceResolverMode
      • RuntimeMaterialProperties
      • RuntimeMaterialProperty
      • RuntimeMaterialPropertyType
      • SceneReferenceResolver
      • SceneReferenceResolverEditor
      • UnityEditorInternalException
    • Bayat.Core.EditorWindows
      • AssetReferenceManagerWindow
      • AssetReferenceManagerWindow.Styles
      • DatabaseMigrationWindow
      • DatabaseMigrationWindow.SceneMigrationStatus
      • DatabaseMigrationWindow.Styles
      • EditorWindowExtensions
      • EditorWindowUtility
      • EditorWindowWrapper
      • SceneReferenceManagerWindow
      • SceneReferenceManagerWindow.Styles
      • WindowClose
      • WrappedEditorWindow
    • Bayat.Core.Profiling
      • ProfiledSegment
      • ProfiledSegmentCollection
      • ProfilingScope
      • ProfilingUtility
    • Bayat.Core.Reflection
      • AssemblyExtensions
      • Codebase
      • RuntimeCodebase
      • TypeExtensions
      • TypeUtility
    • Bayat.Core.Text
      • StringExtensions
      • StringUtility
    • Bayat.Core.Utilities
      • ExceptionExtensions
      • GuidToReferenceDictionary
      • SerializableDictionary<TKey, TVal>
    • Bayat.Json
      • ConstructorHandling
      • CreateObjectConverterWindow
      • CreateObjectConverterWindow.Styles
      • DateFormatHandling
      • DateParseHandling
      • DateTimeZoneHandling
      • DefaultValueHandling
      • FloatFormatHandling
      • FloatParseHandling
      • Formatting
      • GameObjectSerializationHandler
      • GameObjectSerializationManagerTreeView
      • GameObjectSerializationManagerTreeView.Styles
      • GameObjectSerializationManagerWindow
      • GameObjectSerializationManagerWindow.Styles
      • IArrayPool<T>
      • IJsonLineInfo
      • JsonArrayAttribute
      • JsonConstructorAttribute
      • JsonContainerAttribute
      • JsonContainerType
      • JsonConvert
      • JsonConverter
      • JsonConverterAttribute
      • JsonConverterCollection
      • JsonDefaultSettingsWindow
      • JsonDefaultSettingsWindow.Styles
      • JsonDictionaryAttribute
      • JsonException
      • JsonExtensionDataAttribute
      • JsonIgnoreAttribute
      • JsonObjectAttribute
      • JsonPosition
      • JsonPropertyAttribute
      • JsonReader
      • JsonReader.State
      • JsonReaderException
      • JsonRequiredAttribute
      • JsonSerializationException
      • JsonSerializer
      • JsonSerializerSettings
      • JsonSerializerSettingsPreset
      • JsonTextReader
      • JsonTextWriter
      • JsonToken
      • JsonWriter
      • JsonWriter.State
      • JsonWriterException
      • MemberSerialization
      • MetadataPropertyHandling
      • MissingMemberHandling
      • NullValueHandling
      • ObjectCreationHandling
      • PreserveReferencesHandling
      • ReadType
      • ReferenceLoopHandling
      • Required
      • StringEscapeHandling
      • TypeNameHandling
      • WriteState
    • Bayat.Json.Bson
      • BsonArray
      • BsonBinary
      • BsonBinaryType
      • BsonBinaryWriter
      • BsonObject
      • BsonObjectId
      • BsonProperty
      • BsonReader
      • BsonRegex
      • BsonString
      • BsonToken
      • BsonType
      • BsonValue
      • BsonWriter
    • Bayat.Json.Converters
      • AnimatorConverter
      • AudioClipConverter
      • BinaryConverter
      • BoundsConverter
      • BsonObjectIdConverter
      • ColliderConverter
      • ColorConverter
      • CustomCreationConverter<T>
      • DateTimeConverterBase
      • DiscriminatedUnionConverter
      • EntityKeyMemberConverter
      • ExpandoObjectConverter
      • GameObjectConverter
      • HashSetConverter
      • IsoDateTimeConverter
      • JavaScriptDateTimeConverter
      • KeyValuePairConverter
      • MaterialConverter
      • MaterialConverter.JsonSerializedMaterialProperty
      • Matrix4x4Converter
      • MeshConverter
      • MeshConverter.SerializedIndices
      • MeshFilterConverter
      • ObjectJsonConverter
      • QuaternionConverter
      • RectConverter
      • RectTransformConverter
      • RegexConverter
      • RendererConverter
      • ResolutionConverter
      • ShaderConverter
      • SpriteConverter
      • StringEnumConverter
      • Texture2DConverter
      • TransformConverter
      • UnityBehaviourConverter
      • UnityComponentConverter
      • UnityMonoBehaviourConverter
      • UnityObjectConverter
      • UriConverter
      • VectorConverter
      • VersionConverter
      • XmlNodeConverter
    • Bayat.Json.Linq
      • CommentHandling
      • Extensions
      • IJEnumerable<T>
      • JArray
      • JConstructor
      • JContainer
      • JEnumerable<T>
      • JObject
      • JProperty
      • JPropertyDescriptor
      • JPropertyKeyedCollection
      • JRaw
      • JsonLoadSettings
      • JsonMergeSettings
      • JToken
      • JTokenEqualityComparer
      • JTokenReader
      • JTokenType
      • JTokenWriter
      • JValue
      • LineInfoHandling
      • MergeArrayHandling
      • MergeNullValueHandling
    • Bayat.Json.Linq.JsonPath
      • ArrayIndexFilter
      • ArrayMultipleIndexFilter
      • ArraySliceFilter
      • BooleanQueryExpression
      • CompositeExpression
      • FieldFilter
      • FieldMultipleFilter
      • JPath
      • PathFilter
      • QueryExpression
      • QueryFilter
      • QueryOperator
      • ScanFilter
    • Bayat.Json.Serialization
      • CachedAttributeGetter<T>
      • CamelCasePropertyNamesContractResolver
      • DefaultContractResolver
      • DefaultContractResolver.EnumerableDictionaryWrapper<TEnumeratorKey, TEnumeratorValue>
      • DefaultContractResolverState
      • DefaultReferenceResolver
      • DefaultSerializationBinder
      • DefaultSerializationBinder.TypeNameKey
      • DiagnosticsTraceWriter
      • ErrorContext
      • ErrorEventArgs
      • ExpressionValueProvider
      • ExtensionDataGetter
      • ExtensionDataSetter
      • IAttributeProvider
      • IContractResolver
      • IReferenceResolver
      • ITraceWriter
      • IValueProvider
      • JsonArrayContract
      • JsonContainerContract
      • JsonContract
      • JsonContractType
      • JsonDictionaryContract
      • JsonDynamicContract
      • JsonFormatterConverter
      • JsonISerializableContract
      • JsonLinqContract
      • JsonObjectContract
      • JsonPrimitiveContract
      • JsonProperty
      • JsonPropertyCollection
      • JsonSerializerInternalBase
      • JsonSerializerProxy
      • JsonSerializerReader
      • JsonSerializerReader.CreatorPropertyContext
      • JsonSerializerReader.PropertyPresence
      • JsonSerializerWriter
      • JsonStringContract
      • JsonTypeReflector
      • MemoryTraceWriter
      • ObjectConstructor<T>
      • OnErrorAttribute
      • ReflectionAttributeProvider
      • ReflectionValueProvider
      • ResolverContractKey
      • SerializationCallback
      • SerializationErrorCallback
      • TraceJsonReader
      • TraceJsonWriter
    • Bayat.Json.Shims
      • PreserveAttribute
    • Bayat.Json.Utilities
      • Base64Encoder
      • BidirectionalDictionary<TFirst, TSecond>
      • BufferUtils
      • CollectionUtils
      • CollectionWrapper<T>
      • ConvertUtils
      • ConvertUtils.ConvertResult
      • ConvertUtils.TypeConvertKey
      • Creator<T>
      • DateTimeParser
      • DateTimeUtils
      • DictionaryWrapper<TKey, TValue>
      • DynamicProxy<T>
      • DynamicProxyMetaObject<T>
      • DynamicUtils
      • DynamicUtils.BinderWrapper
      • EnumUtils
      • EnumValue<T>
      • ExpressionReflectionDelegateFactory
      • FSharpFunction
      • FSharpUtils
      • ImmutableCollectionsUtils
      • ImmutableCollectionsUtils.ImmutableCollectionTypeInfo
      • IWrappedCollection
      • IWrappedDictionary
      • JavaScriptUtils
      • JsonTokenUtils
      • LateBoundReflectionDelegateFactory
      • MathUtils
      • MethodCall<T, TResult>
      • MiscellaneousUtils
      • NoThrowExpressionVisitor
      • NoThrowGetBinderMember
      • NoThrowSetBinderMember
      • ParseResult
      • ParserTimeZone
      • PrimitiveTypeCode
      • PropertyNameTable
      • ReflectionDelegateFactory
      • ReflectionMember
      • ReflectionObject
      • ReflectionUtils
      • StringBuffer
      • StringReference
      • StringReferenceExtensions
      • StringUtils
      • ThreadSafeStore<TKey, TValue>
      • TypeInformation
      • ValidationUtils
    • Bayat.SaveSystem
      • AutoSave
      • AutoSaveManager
      • AutoSaveManager.LoadEvent
      • AutoSaveManager.SaveEvent
      • AutoSaveManagerWindow
      • AutoSaveManagerWindow.Styles
      • LoadEventArgs
      • LoadIntoEventArgs
      • SaveEventArgs
      • SaveSystemAPI
      • SaveSystemDefaultSettingsWindow
      • SaveSystemDefaultSettingsWindow.Styles
      • SaveSystemEditorResources
      • SaveSystemJsonSerializer
      • SaveSystemManager
      • SaveSystemSettings
      • SaveSystemSettingsPreset
      • WelcomeWindow
      • WelcomeWindow.Styles
    • Bayat.SaveSystem.Security
      • ISaveSystemEncryption
      • SaveSystemCryptoStream
      • SaveSystemSymmetricCryptoStream
      • SaveSystemSymmetricEncryption
    • Bayat.SaveSystem.Storage
      • BuiltInConnectionFactory
      • ConnectionStringFactory
      • FileStorageStream
      • IConnectionFactory
      • IStorage
      • IStorageStream
      • LocalDiskStorage
      • PlayerPrefsStorage
      • PlayerPrefsStorageStream
      • StorageBackup
      • StorageBase
      • StorageClearOperationResult
      • StorageConnectionString
      • StorageCopyOperationResult
      • StorageDeleteOperationResult
      • StorageFactory
      • StorageFullException
      • StorageInvalidIdentifierException
      • StorageItemNotFoundException
      • StorageListOptions
      • StorageMetaData
      • StorageMoveOperationResult
      • StorageOperationResult
      • StorageStream

    Class StringUtils

    Inheritance
    System.Object
    StringUtils
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: Bayat.Json.Utilities
    Assembly: Bayat.Json.Runtime.dll
    Syntax
    public static class StringUtils

    Fields

    | Improve this Doc View Source

    CarriageReturn

    Declaration
    public const char CarriageReturn = '\r'
    Field Value
    Type Description
    System.Char
    | Improve this Doc View Source

    CarriageReturnLineFeed

    Declaration
    public const string CarriageReturnLineFeed = "\r\n"
    Field Value
    Type Description
    System.String
    | Improve this Doc View Source

    Empty

    Declaration
    public const string Empty = ""
    Field Value
    Type Description
    System.String
    | Improve this Doc View Source

    LineFeed

    Declaration
    public const char LineFeed = '\n'
    Field Value
    Type Description
    System.Char
    | Improve this Doc View Source

    Tab

    Declaration
    public const char Tab = '\t'
    Field Value
    Type Description
    System.Char

    Methods

    | Improve this Doc View Source

    CreateStringWriter(Int32)

    Declaration
    public static StringWriter CreateStringWriter(int capacity)
    Parameters
    Type Name Description
    System.Int32 capacity
    Returns
    Type Description
    System.IO.StringWriter
    | Improve this Doc View Source

    EndsWith(String, Char)

    Declaration
    public static bool EndsWith(this string source, char value)
    Parameters
    Type Name Description
    System.String source
    System.Char value
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    ForgivingCaseSensitiveFind<TSource>(IEnumerable<TSource>, Func<TSource, String>, String)

    Declaration
    public static TSource ForgivingCaseSensitiveFind<TSource>(this IEnumerable<TSource> source, Func<TSource, string> valueSelector, string testValue)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<TSource> source
    System.Func<TSource, System.String> valueSelector
    System.String testValue
    Returns
    Type Description
    TSource
    Type Parameters
    Name Description
    TSource
    | Improve this Doc View Source

    FormatWith(String, IFormatProvider, Object)

    Declaration
    public static string FormatWith(this string format, IFormatProvider provider, object arg0)
    Parameters
    Type Name Description
    System.String format
    System.IFormatProvider provider
    System.Object arg0
    Returns
    Type Description
    System.String
    | Improve this Doc View Source

    FormatWith(String, IFormatProvider, Object, Object)

    Declaration
    public static string FormatWith(this string format, IFormatProvider provider, object arg0, object arg1)
    Parameters
    Type Name Description
    System.String format
    System.IFormatProvider provider
    System.Object arg0
    System.Object arg1
    Returns
    Type Description
    System.String
    | Improve this Doc View Source

    FormatWith(String, IFormatProvider, Object, Object, Object)

    Declaration
    public static string FormatWith(this string format, IFormatProvider provider, object arg0, object arg1, object arg2)
    Parameters
    Type Name Description
    System.String format
    System.IFormatProvider provider
    System.Object arg0
    System.Object arg1
    System.Object arg2
    Returns
    Type Description
    System.String
    | Improve this Doc View Source

    FormatWith(String, IFormatProvider, Object, Object, Object, Object)

    Declaration
    public static string FormatWith(this string format, IFormatProvider provider, object arg0, object arg1, object arg2, object arg3)
    Parameters
    Type Name Description
    System.String format
    System.IFormatProvider provider
    System.Object arg0
    System.Object arg1
    System.Object arg2
    System.Object arg3
    Returns
    Type Description
    System.String
    | Improve this Doc View Source

    GetLength(String)

    Declaration
    public static int? GetLength(string value)
    Parameters
    Type Name Description
    System.String value
    Returns
    Type Description
    System.Nullable<System.Int32>
    | Improve this Doc View Source

    IsHighSurrogate(Char)

    Declaration
    public static bool IsHighSurrogate(char c)
    Parameters
    Type Name Description
    System.Char c
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    IsLowSurrogate(Char)

    Declaration
    public static bool IsLowSurrogate(char c)
    Parameters
    Type Name Description
    System.Char c
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    IsWhiteSpace(String)

    Determines whether the string is all white space. Empty string will return false.

    Declaration
    public static bool IsWhiteSpace(string s)
    Parameters
    Type Name Description
    System.String s

    The string to test whether it is all white space.

    Returns
    Type Description
    System.Boolean

    true if the string is all white space; otherwise, false.

    | Improve this Doc View Source

    NullEmptyString(String)

    Nulls an empty string.

    Declaration
    public static string NullEmptyString(string s)
    Parameters
    Type Name Description
    System.String s

    The string.

    Returns
    Type Description
    System.String

    Null if the string was null, otherwise the string unchanged.

    | Improve this Doc View Source

    StartsWith(String, Char)

    Declaration
    public static bool StartsWith(this string source, char value)
    Parameters
    Type Name Description
    System.String source
    System.Char value
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    ToCamelCase(String)

    Declaration
    public static string ToCamelCase(string s)
    Parameters
    Type Name Description
    System.String s
    Returns
    Type Description
    System.String
    | Improve this Doc View Source

    ToCharAsUnicode(Char, Char[])

    Declaration
    public static void ToCharAsUnicode(char c, char[] buffer)
    Parameters
    Type Name Description
    System.Char c
    System.Char[] buffer
    • Improve this Doc
    • View Source
    • 0 Comments
    In This Article
    • Fields
      • CarriageReturn
      • CarriageReturnLineFeed
      • Empty
      • LineFeed
      • Tab
    • Methods
      • CreateStringWriter(Int32)
      • EndsWith(String, Char)
      • ForgivingCaseSensitiveFind<TSource>(IEnumerable<TSource>, Func<TSource, String>, String)
      • FormatWith(String, IFormatProvider, Object)
      • FormatWith(String, IFormatProvider, Object, Object)
      • FormatWith(String, IFormatProvider, Object, Object, Object)
      • FormatWith(String, IFormatProvider, Object, Object, Object, Object)
      • GetLength(String)
      • IsHighSurrogate(Char)
      • IsLowSurrogate(Char)
      • IsWhiteSpace(String)
      • NullEmptyString(String)
      • StartsWith(String, Char)
      • ToCamelCase(String)
      • ToCharAsUnicode(Char, Char[])