C# 클래스 StringUtils, GPUNoiseForUnity

파일 보기 프로젝트 열기: heyx3/GPUNoiseForUnity 1 사용 예제들

공개 메소드들

메소드 설명
FixDirectorySeparators ( string path ) : string

Replaces all directory separators with the correct one for the current platform (either / or \).

GetRelativePath ( string fullPath, string startFolder ) : string

Turns the given full path into a relative one starting just above the given directory. For example, "GetRelativePath("C:/A/B/C", "B")" returns "B/C". Returns "null" if the given folder can't be found.

As a side effect, all '/' or '\' slashes will be changed to the correct directory separator char for this platform.

IncrementNumberPostfix ( string str ) : string

If the given string ends in a number, increments that number. Otherwise, appends a "2" to it.

PrettifyVarName ( string name ) : string

Turns the given variable name into a nice display name.

RemoveEverythingBefore ( this str, char c ) : string

Finds the last instance of the given char and removes it along with everything that came before it.

ToCodeString ( this f ) : string

Gets this float as a code-parseable string. In other words, if this float's default string representation is scientific notation, this method automatically fixes that.

메소드 상세

FixDirectorySeparators() 공개 정적인 메소드

Replaces all directory separators with the correct one for the current platform (either / or \).
public static FixDirectorySeparators ( string path ) : string
path string
리턴 string

GetRelativePath() 공개 정적인 메소드

Turns the given full path into a relative one starting just above the given directory. For example, "GetRelativePath("C:/A/B/C", "B")" returns "B/C". Returns "null" if the given folder can't be found.
As a side effect, all '/' or '\' slashes will be changed to the correct directory separator char for this platform.
public static GetRelativePath ( string fullPath, string startFolder ) : string
fullPath string
startFolder string /// The folder that will appear at the top of the returned path. ///
리턴 string

IncrementNumberPostfix() 공개 정적인 메소드

If the given string ends in a number, increments that number. Otherwise, appends a "2" to it.
public static IncrementNumberPostfix ( string str ) : string
str string
리턴 string

PrettifyVarName() 공개 정적인 메소드

Turns the given variable name into a nice display name.
public static PrettifyVarName ( string name ) : string
name string
리턴 string

RemoveEverythingBefore() 공개 정적인 메소드

Finds the last instance of the given char and removes it along with everything that came before it.
public static RemoveEverythingBefore ( this str, char c ) : string
str this
c char
리턴 string

ToCodeString() 공개 정적인 메소드

Gets this float as a code-parseable string. In other words, if this float's default string representation is scientific notation, this method automatically fixes that.
public static ToCodeString ( this f ) : string
f this
리턴 string