C# 클래스 Utilities.IO.Extensions.StringExtensions

Extension methods for strings
파일 보기 프로젝트 열기: feanz/Utilities

공개 메소드들

메소드 설명
CreateToFile ( this fileText, string absolutePath ) : void

Creates or opens a file for writing and writes text to it. Very simple quick file write.

GetFileText ( this absolutePath ) : string

Read a text file and obtain it's contents.

RemoveIllegalDirectoryNameCharacters ( this directoryName, char replacementChar = '_' ) : string

Removes illegal characters from a directory

RemoveIllegalFileNameCharacters ( this fileName, char replacemetChar = '_' ) : string

Removes illegal characters from a file

UpdateFileText ( this absolutePath, string lookFor, string replaceWith ) : void

Update text within a file by replacing a substring within the file.

WriteToFile ( this absolutePath, string fileText ) : void

Writes out a string to a file. Very simple quick file write.

메소드 상세

CreateToFile() 공개 정적인 메소드

Creates or opens a file for writing and writes text to it. Very simple quick file write.
public static CreateToFile ( this fileText, string absolutePath ) : void
fileText this A String containing text to be written to the file.
absolutePath string The complete file path to write to.
리턴 void

GetFileText() 공개 정적인 메소드

Read a text file and obtain it's contents.
public static GetFileText ( this absolutePath ) : string
absolutePath this The complete file path to write to.
리턴 string

RemoveIllegalDirectoryNameCharacters() 공개 정적인 메소드

Removes illegal characters from a directory
public static RemoveIllegalDirectoryNameCharacters ( this directoryName, char replacementChar = '_' ) : string
directoryName this Directory name
replacementChar char Replacement character
리턴 string

RemoveIllegalFileNameCharacters() 공개 정적인 메소드

Removes illegal characters from a file
public static RemoveIllegalFileNameCharacters ( this fileName, char replacemetChar = '_' ) : string
fileName this File name
replacemetChar char Replacement character
리턴 string

UpdateFileText() 공개 정적인 메소드

Update text within a file by replacing a substring within the file.
public static UpdateFileText ( this absolutePath, string lookFor, string replaceWith ) : void
absolutePath this The complete file path to write to.
lookFor string A String to be replaced.
replaceWith string A String to replace all occurrences of lookFor.
리턴 void

WriteToFile() 공개 정적인 메소드

Writes out a string to a file. Very simple quick file write.
public static WriteToFile ( this absolutePath, string fileText ) : void
absolutePath this The complete file path to write to.
fileText string A String containing text to be written to the file.
리턴 void