UserInitials
Gambas
Bestimmen der Anfangsbuchstaben der Wörter eines Textes, z.B. Username.
FUNCTION Initials( Value AS String ) AS String
DIM result AS String
DIM nc AS Boolean
DIM i AS Integer
result = ""
IF uname THEN
nc = TRUE
FOR i = 1 TO Len(uname)
IF Mid(uname, i, 1) = " " THEN
nc = TRUE
ELSE
IF nc THEN
result = result & Mid(uname, i, 1)
nc = FALSE
END IF
END IF
NEXT
END IF
RETURN result END FUNCTION