PlayerPrefs.SetString

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

Description

Sets the value of the preference identified by key.

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

using UnityEngine;
using System.Collections;

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

import UnityEngine
import System.Collections

class example(MonoBehaviour):

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