Browse Source

String: Fix documentation for getTrailingIntValue

tags/2021-05-28
reuk 4 years ago
parent
commit
c41149f48d
No known key found for this signature in database GPG Key ID: 9ADCD339CFC98A11
2 changed files with 4 additions and 1 deletions
  1. +2
    -0
      modules/juce_core/text/juce_String.cpp
  2. +2
    -1
      modules/juce_core/text/juce_String.h

+ 2
- 0
modules/juce_core/text/juce_String.cpp View File

@@ -2577,6 +2577,8 @@ public:
expect (String (std::numeric_limits<int64>::max()).getLargeIntValue() == std::numeric_limits<int64>::max());
expect (String (std::numeric_limits<int64>::min()).getLargeIntValue() == std::numeric_limits<int64>::min());
expect (("xyz" + s).getTrailingIntValue() == s.getIntValue());
expect (String ("xyz-5").getTrailingIntValue() == -5);
expect (String ("-12345").getTrailingIntValue() == -12345);
expect (s.getHexValue32() == 0x12345678);
expect (s.getHexValue64() == (int64) 0x12345678);
expect (String::toHexString (0x1234abcd).equalsIgnoreCase ("1234abcd"));


+ 2
- 1
modules/juce_core/text/juce_String.h View File

@@ -1049,7 +1049,8 @@ public:
This will look for a value at the end of the string.
e.g. for "321 xyz654" it will return 654; for "2 3 4" it'll return 4.
Negative numbers are not handled, so "xyz-5" returns 5.
If the string ends with a hyphen followed by numeric characters, the
return value will be negative.
@see getIntValue
*/


Loading…
Cancel
Save