Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pharo: #( $H $e $l $l $o ).'Hello' has no example in Finder

When I go to the finder and select "Examples" then I can't figure out how to find a method that turns #( $H $e $l $l $o ). into 'Hello'. Nor does MethodFinder new findMethodsByExampleInput: #( $H $e $l $l $o ) andExpectedResult: 'Hello'. work.

know how to do it(*), but I want to know how to utilize the Finder.

I guess the Finder simply can't find it? Am I missing something?

(*) For example, one way to do it i: String newFrom: #( $H $e $l $l $o ).. Another way would be: #($H $e $l $l $o) inject: '' into: [ :acc :el | acc, (el asString) ]. (though I would not expect the second way to be found by the Finder)

enter image description here

like image 909
Melvin Roest Avatar asked Oct 25 '25 12:10

Melvin Roest


1 Answers

If you think about it like adding a collection of characters to a string rather than converting a collection to a string you can search for:

'' . #( $H $e $l $l $o ) . 'Hello'

in the Finder and you will get the results:

#( $H $e $l $l $o ) joinUsing: '' -> 'Hello'
'' , #( $H $e $l $l $o ) -> 'Hello'
'' join: #( $H $e $l $l $o ) -> 'Hello'
like image 134
Steven Vogel Avatar answered Oct 27 '25 05:10

Steven Vogel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!