PlayerPrefs.SetString Manual     Reference     Scripting  
Scripting > Runtime Classes > PlayerPrefs
PlayerPrefs.SetString

static function SetString (key : string, value : string) : void

Description

Sets the value of the preference identified by key.

JavaScripts
PlayerPrefs.SetString("Player Name", "Foobar");

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
void Awake() {
PlayerPrefs.SetString("Player Name", "Foobar");
}
}

import UnityEngine
import System.Collections

class example(MonoBehaviour):

def Awake():
PlayerPrefs.SetString('Player Name', 'Foobar')