Difference between revisions of "UName2Username"

From Second Life Wiki
Jump to navigation Jump to search
m (tweaked & commentd question at the bottom)
m (anyone know how to force the lowercase first letter links like on the native functions category page?)
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 -->
{{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>__NOEDITSECTION__
<div style="float:right;">__TOC__</div>
{{DISPLAYTITLE:uName2Username}}
{{DISPLAYTITLE:uName2Username}}
{{void-box
{{void-box
Line 42: Line 42:
* [[llGetUsername]]
* [[llGetUsername]]
}}
}}
[[Category:LSL_User-Defined_Functions|Name2Username]]
[[Category:LSL_User-Defined_Functions|Name2Username|uName2Username]]
 
<!-- anyone know how to force the lowercase first letter like on the native functions category page? -->

Revision as of 15:59, 11 January 2011

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

Returns a string that is vStrNom converted to a Username.

  • vStrNom: source name string


Code:

  • LSO: 116 bytes
  • MONO: 512 bytes

<lsl>string uName2Username( string vStrNom ){ return llDumpList2String( llParseString2List( llToLower( vStrNom ), [" resident", " "], [] ), "." ); } /*//-- 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 ] //*/

/*//-- --//*/</lsl>

Caveats

  • This function does not check input name validity

Notes

  • Useful for formatting legacy name sources (like notecard access lists) for condensed storage.