Replacement









How do I use Replacement
Below are practical examples compiled from projects for learning and reference purposes

Featured Snippets


File name: PhotonConverter.cs Copy
323     static string PregReplace(string input, string[] pattern, string[] replacements)
324     {
325         if (replacements.Length != pattern.Length)
326             Debug.LogError("Replacement and Pattern Arrays must be balanced");
327
328         for (var i = 0; i < pattern.Length; i++)
329         {
330             input = Regex.Replace(input, pattern[i], replacements[i]);
331         }
332
333         return input;
334     }
File name: PhotonConverter.cs Copy
335     static string PregReplace(string input, string pattern, string replacement)
336     {
337         return Regex.Replace(input, pattern, replacement);
338
339     }

Replacement 129 lượt xem

Gõ tìm kiếm nhanh...