// Filter method applies predicate on optional content
// Resulting optional will be non empty only if predicate returns true and original value inside
// optional was not empty.
Filter method applies predicate on optional content
Resulting optional will be non empty only if predicate returns true and original value inside
optional was not empty.
// Filter method applies predicate on optional content // Resulting optional will be non empty only if predicate returns true and original value inside // optional was not empty .
func (s String) Filter(f func(string) bool) String {
	if f == nil || !s.IsPresent() || !f(s.value) {
		return String{}
	}
	return s
}
func ( s String ) Filter ( f func ( string ) bool ) String { if f == nil || ! s . IsPresent ( ) || ! f ( s . value ) { return String { } } return s }
Filter method applies predicate on optional content
Resulting optional will be non empty only if predicate returns true and original value inside
optional was not empty.
Filter method applies predicate on optional content Resulting optional will be non empty only if predicate returns true and original value inside optional was not empty .