This wiki is a read-only version of the Stardew Valley Wiki. The official editable wiki maintained by ConcernedApe can be found at stardewvalleywiki.com

Changes

Jump to: navigation, search

Modding:Modder Guide/APIs/Utilities

12 bytes added, 23:46, 8 September 2020
File paths: update for SMAPI 3.7 release
{{SMAPI upcoming|3.7}}
<tt>PathUtilities</tt> provides utility methods for working with file pathsand [[Modding:Modder Guide/APIs/Content|asset names]], complementing the <tt>Path</tt> class provided by .NET:
{| class="wikitable"
| Get whether a string can be used as a 'slug', containing only basic characters that are safe in all contexts (e.g. filenames, URLs, SMAPI IDs, etc).
|-
| <code>NormalizePathSeparatorsNormalizePath</code>| Normalize directory separators file paths or asset names to match the format used by the current OS. For example:
<source lang="c#">string path = PathUtilities.NormalizePathSeparators(@"Characters/\Dialogue//Abigail");
// Linux/Mac: "Characters/Dialogue/Abigail"
// Windows: "Characters\Dialogue\Abigail"
</source>
|}
 
This is also useful for working with
===Semantic versions===
Protected, translators
5,421
edits

Navigation menu