Returns a new Characters object containing all the characters of this instance minus all characters of the
given instance.

@param other the other Characters to remove
@return a new Characters object
545172
public Characters remove(Characters other) {
        checkArgNotNull(other, "other");
        if (!subtractive && !other.subtractive) {
            return removeFromChars(other.chars);
        }
        if (subtractive && other.subtractive) {
            return new Characters(false, other.removeFromChars(chars).chars);
        }
        return subtractive ? addToChars(other.chars) : retainAllChars(other.chars);
    }
599581
def strings(self, otherchar=None):
		'''
			
		'''

		# In the case of a regex like "[^abc]", there are infinitely many (well, a
		# very large finite number of) single characters which will match. It's not
		# productive to iterate over all of these giving every single example.
		# You must supply your own "otherchar" to stand in for all of these
		# possibilities.
		for string in self.to_fsm().strings():

			# Have to represent `fsm.anything_else` somehow.
			if fsm.anything_else in string:
				if otherchar == None:
					raise Exception("Please choose an 'otherchar'")
				string = [
					otherchar if char == fsm.anything_else else char
					for char in string
				]

			yield "".join(string)
756830
public void copyRemainder(Text other) {
        other.chars = this.chars;
        other.pos = this.linePointer + 1;
        other.len = this.len - this.linePointer - 1;
    }
1352791
@Override
    public int compareTo(final MutableChar other) {
        return (this.value > other.value) ? 1 : ((this.value == other.value) ? 0 : -1);
    }
394703
@Override
  public ByteAmount minus(ResourceMeasure<Long> other) {
    checkArgument(Long.MIN_VALUE + other.value <= value,
        String.format("Subtracting %s from %s would overshoot Long.MIN_LONG", other, this));
    return ByteAmount.fromBytes(value - other.value);
  }
1144702
public Separator hsplit(Separator other)
	{
	    Rectangular r = super.hsplit(other);
	    if (r == null)
	        return null;
	    else
	        return new Separator(type, r);
	}
20492
public UpdateDescription merge(@Nullable final UpdateDescription otherDescription) {
    if (otherDescription != null) {
      for (final Map.Entry<String, BsonValue> entry : this.updatedFields.entrySet()) {
        if (otherDescription.removedFields.contains(entry.getKey())) {
          this.updatedFields.remove(entry.getKey());
        }
      }
      for (final String removedField : this.removedFields) {
        if (otherDescription.updatedFields.containsKey(removedField)) {
          this.removedFields.remove(removedField);
        }
      }

      this.removedFields.addAll(otherDescription.removedFields);
      this.updatedFields.putAll(otherDescription.updatedFields);
    }

    return this;
  }
795359
public static Slice leftTrim(Slice utf8)
    {
        int length = utf8.length();

        int position = firstNonWhitespacePosition(utf8);
        return utf8.slice(position, length - position);
    }
927566
public Object encode(Object o) {
        if(o instanceof String) {
            // create a new copy of the String instance            
            return new String((String)o);
        } else if(o instanceof CharSequence) {
            // convert CharSequence to String so that we have a new instance
            return String.valueOf(o);
        } else {
            return o;
        }
    }
793118
public static NotLike notLike(Expression<String> left, Expression<String> right, char wildCardCharacter) {
        return new NotLike(left, right, wildCardCharacter);
    }
1052359
@Override
	public int compareTo(CharValue o) {
		final int other = o.value;
		return this.value < other ? -1 : this.value > other ? 1 : 0;
	}
1278683
public static String concat(String[] parts, char character) {
    StringBuilder stringBuilder = new StringBuilder();

    for (String part : parts) {
      stringBuilder.append(part).append(character);
    }

    stringBuilder.deleteCharAt(stringBuilder.length() - 1);

    return stringBuilder.toString();
  }
980934
public Regex and(@NonNull Regex other) {
      if (other.pattern.length() > 0) {
         return re(this.pattern + "&&" + other.pattern);
      }
      return this;
   }
199945
public Curies mergeWith(final Curies other) {
        final Curies merged = copyOf(this);
        other.curies.forEach(merged::register);
        return merged;
    }
861982
public static Character toCharacter(Object o, Character defaultValue) {
	if (o instanceof Character) return (Character) o;
	if (defaultValue != null) return new Character(toCharValue(o, defaultValue.charValue()));

	char res = toCharValue(o, Character.MIN_VALUE);
	if (res == Character.MIN_VALUE) return defaultValue;
	return new Character(res);
    }
229341
@CheckReturnValue
  public ErrorProneFlags plus(ErrorProneFlags other) {
    Map<String, String> combinedMaps = new HashMap<>(this.getFlagsMap());
    combinedMaps.putAll(other.getFlagsMap());
    return ErrorProneFlags.fromMap(combinedMaps);
  }
957397
public char[] getCharacters(final int size, final int bad) {
		if (size == 0) {
			return new char[0];
		}
		char[] chars = new char[size];
		for (int i = 0; i < chars.length; i++) {
			chars[i] = field.getAllowedCharacter();
		}
		// remove leading blanks
		for (int i = 0; i < 10 && Character.isSpaceChar(chars[0]); i++) {
			chars[0] = field.getAllowedCharacter();
		}
		// remove trailing blanks
		for (int i = 0; i < 10 && Character.isSpaceChar(chars[chars.length - 1]); i++) {
			chars[chars.length - 1] = field.getAllowedCharacter();
		}
		int toBeReplaced = bad;
		if (-2 == bad) {
			if (!canBad()) {
				if (log.isDebugEnabled()) {
					log.debug("This node does not allow negative characters, " + "but as all characters shall be negative no character is returned");
				}
				return new char[0];
			}
			toBeReplaced = chars.length;
		} else if (-1 == bad) {
			// 1 - (all -1) characters are replaced
			toBeReplaced = 1 + rnd.getInt(chars.length - 2);
		}
		if (toBeReplaced > 0) {
			// create a random index list
			List<Integer> l = new ArrayList<Integer>(chars.length);
			for (int i = 0; i < chars.length; i++) {
				l.add(i);
			}
			Collections.shuffle(l);
			for (int i = 0; i < toBeReplaced; i++) {
				int index = l.remove(0);
				Character currentBad = field.getForbiddenCharacter();
				if (currentBad == null) {
					log.warn("This node does not allow negative characters");
					break;
				}
				// The first and the last character as a forbidden character is not a space!
				// this would usually shorten the length
				if (index == 0 || index == chars.length - 1) {
					int counter = 0;
					while (counter < 100 && Character.isSpaceChar(currentBad)) {
						currentBad = field.getForbiddenCharacter();
						counter++;
					}
					if (counter == 100) {
						log.warn("Space is the only possible forbidden character for this node, no replacement!");
						break;
					}
				}
				if (log.isDebugEnabled()) {
					log.debug("Replace Character " + Character.toString(chars[index]) + " with " + Character.toString(currentBad));
				}
				chars[index] = currentBad;
			}
		}
		return chars;
	}