Advertisement
Muk99

StringExtensionsExample

Feb 13th, 2015
313
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.39 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public static class StringExtensions {
  5.     public static void PrintWithDate (this string s) {
  6.         Debug.Log (s + System.DateTime.Now.ToString ());
  7.     }
  8. }
  9.  
  10. public class StringDateCaller : MonoBehaviour {
  11.     string myString = "Now its ";
  12.  
  13.     void Start () {
  14.         //This will print the string whit the actual date and time
  15.         myString.PrintWithDate ();
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement