Removed trimmed_string function and callers, and for now, use (left_|right_)adjust
This commit is contained in:
@@ -12,30 +12,19 @@ inherit
|
||||
|
||||
feature {NONE} -- Helpers
|
||||
|
||||
entity_value (a_str: READABLE_STRING_8): READABLE_STRING_8
|
||||
entity_value (a_str: READABLE_STRING_8): STRING_8
|
||||
-- `s' with any trailing parameters stripped
|
||||
local
|
||||
p: INTEGER
|
||||
do
|
||||
p := a_str.index_of (';', 1)
|
||||
if p > 0 then
|
||||
Result := trimmed_string (a_str.substring (1, p - 1))
|
||||
create Result.make_from_string (a_str.substring (1, p - 1))
|
||||
else
|
||||
Result := trimmed_string (a_str.string)
|
||||
create Result.make_from_string (a_str)
|
||||
end
|
||||
end
|
||||
|
||||
trimmed_string (a_string: READABLE_STRING_8): STRING_8
|
||||
-- trim whitespace from the beginning and end of a string
|
||||
-- `a_string'
|
||||
require
|
||||
valid_argument : a_string /= Void
|
||||
do
|
||||
create Result.make_from_string (a_string)
|
||||
Result.left_adjust
|
||||
Result.right_adjust
|
||||
ensure
|
||||
result_trimmed: a_string.has_substring (Result)
|
||||
end
|
||||
|
||||
note
|
||||
|
||||
Reference in New Issue
Block a user