Difference between revisions of "UName2Legacy"

From Second Life Wiki
Jump to navigation Jump to search
m (more quick code)
 
m (<lsl> tag to <source>)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
{{LSL Header|[[:Category:LSL_User-Defined_Functions|User-Defined Functions]]|[[User:Void_Singer|Void's User Page]]}} <!-- please do not remove added links --><div style="float:right;">__TOC__</div>
{{LSL Header|[[:Category:LSL_User-Defined_Functions|User-Defined Functions]]|[[User:Void_Singer|Void's User Page]]}} <!-- please do not remove added links -->
{{DISPLAYTITLE:uName2Legacy}}{{DEFAULTSORTKEY:Name2Legacy}}
<div style="float:right;">__TOC__</div>
{{DISPLAYTITLE:uName2Legacy}}
{{void-box
{{void-box
|title=<div id="box" style="display:none"><h2>Summary</h2></div>[[:Category:LSL_User-Defined_Functions|User-Defined Function]]: [[string]] uName2Legacy( [[string]] ''vStrNom'' );
|title=<div id="box" style="display:none"><h2>Summary</h2></div>[[:Category:LSL_User-Defined_Functions|User-Defined Function]]: [[string]] uName2Legacy( [[string]] ''vStrNom'' );
Line 11: Line 12:
* LSO: 152 bytes
* LSO: 152 bytes
* MONO: 512 bytes
* MONO: 512 bytes
<lsl>string uName2Legacy( string vStrNom ){
<source lang="lsl2">string uName2Legacy( string vStrNom ){
return llDumpList2String( llList2List( llParseString2List( llToLower( vStrNom ), [".", " "], [] ) + (list)"resident", 0, 1 ), " " );
return llDumpList2String( llList2List( llParseString2List( llToLower( vStrNom ), [".", " "], [] ) + (list)"resident", 0, 1 ), " " );
}
}
Line 18: Line 19:
/*//  2011 (CC0) [ http://creativecommons.org/publicdomain/zero/1.0 ]  //*/
/*//  2011 (CC0) [ http://creativecommons.org/publicdomain/zero/1.0 ]  //*/
/*//  Void Singer [ https://wiki.secondlife.com/wiki/User:Void_Singer ]  //*/
/*//  Void Singer [ https://wiki.secondlife.com/wiki/User:Void_Singer ]  //*/
/*//--                                                                --//*/</lsl><!-- Please do not remove license statement -->
/*//--                                                                --//*/</source><!-- Please do not remove license statement -->
}}
}}


Line 43: Line 44:
* [[llGetUsername]]
* [[llGetUsername]]
}}
}}
[[Category:LSL_User-Defined_Functions|User-Defined Functions]]
[[Category:LSL_User-Defined_Functions|Name2Legacy]]

Latest revision as of 15:29, 22 January 2015

User-Defined Function: string uName2Legacy( string vStrNom );

Returns a string that is vStrNom converted to a Legacy Name.(see Caveats)

  • vStrNom: source name string


Code:

  • LSO: 152 bytes
  • MONO: 512 bytes
string uName2Legacy( string vStrNom ){
	return llDumpList2String( llList2List( llParseString2List( llToLower( vStrNom ), [".", " "], [] ) + (list)"resident", 0, 1 ), " " );
}
/*//--                       Anti-License Text                         --//*/
/*//     Contributed Freely to the Public Domain without limitation.     //*/
/*//   2011 (CC0) [ http://creativecommons.org/publicdomain/zero/1.0 ]   //*/
/*//  Void Singer [ https://wiki.secondlife.com/wiki/User:Void_Singer ]  //*/
/*//--                                                                 --//*/

Caveats

Notes

  • Useful for formatting username sources (like notecard access lists) for faster processing against legacy name sources (like llKey2Name)