[Gambas-user] Boxed string question

Gianluigi bagonergi at gmail.com
Wed Sep 11 15:44:18 CEST 2019


Hi Cedron,
thank you very much for all the suggestions ;-)

Regards
Gianluigi

Il giorno mer 11 set 2019 alle ore 15:32 Cedron Dawg <cedron at exede.net> ha
scritto:

> Because of the "Syntax Sugar" string concatenation thing I would do it
> somewhat like this:
>
> '==================================================
> Private Function ProperCase(value As String) As String
>
>   Dim O As Stream, Q As String
>
>   O = Open String For Write
>
>   Dim ss As String[] = Split(value, " ")
>
>   For Each s As String In ss
>     Print #O, String.UCaseFirst(s); " ";
>   Next
>
>   Q = Close #O
>
>   Return RTrim(Q)
>
> End
> '==================================================
>
> I second the call for a built in "ProperCase" function.
>
> It would also be nice to have a set of calls back and forth between a
> ProperCase name and a DB safe name, i.e. all lower case with underscored
> separators.
>
> HomeAddress <===> home_address
>
> Ced
>
>
> ----- Original Message -----
> From: "Gianluigi" <bagonergi at gmail.com>
>
> ....
>
> What do you think about these solutions (obviously the second solution is
> not mine :-P)?
>
> Private Function ProperCase(value As String) As String
>
> Dim ss As String[] = Split(value, " ")
>
> value = ""
> For Each s As String In ss
> value &= String.UCaseFirst(s) & " "
> Next
> Return RTrim(value)
>
> End
>
> .....
>
> Benoit, how about adding a new string function?
>
> Regards
> Gianluigi
>
>
> ----[ Gambas mailing-list is hosted by https://www.hostsharing.net ]----
>
>
> ----[ Gambas mailing-list is hosted by https://www.hostsharing.net ]----
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20190911/db2c3d8e/attachment-0001.html>


More information about the User mailing list