The reason I didn't post this only in my function thread in members section is that the people who would really use this would most likely be Junior Members and registered users, who maybe enjoy cool small snippets like a function that frees you from parsing the nickname from your username.
Anyhow, here it is:
SCAR Code:
program New;
{.include SRL/SRL/Misc/ArrayLoader.scar}
Function Capitalized(C: Char): Boolean;
Begin
Result := LowerCase(C) <> C;
End;
Function GetNick(Username: String; NickLength: Integer): String;
Var
Parts, validParts: TStringArray;
z, q, w, i, c: Integer;
Begin
Parts := StrToStrArray(Username);
SetArrayLength(validParts, GetArrayLength(Parts));
For I := 0 To High(Parts) Do
If Length(Parts[i]) >= NickLength Then
Begin
validParts[z] := Parts[i];
z := z + 1;
End;
SetArrayLength(validParts, z);
For I := 0 To Z Do
Begin
For C := 1 To Length(validParts[i]) Do
If Not Capitalized(validParts[i][c]) Then
If q <= 3 Then
q := q + 1
Else
Break
Else
w := w + 1;
If q >= NickLength Then
Begin
Result := Copy(validParts[i], w + 1, q);
Exit;
End;
End;
End;
begin
Writeln(GetNick('Ran2dom Name', 3));
end.
Capitalized: Boolean by Wizzup