StringArrayUtils.java 2.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. package com.zipcodewilmington;
  2. /**
  3. * Created by leon on 1/29/18.
  4. */
  5. public class StringArrayUtils {
  6. /**
  7. * @param array array of String objects
  8. * @return first element of specified array
  9. */ // TODO
  10. public static String getFirstElement(String[] array) {
  11. return null;
  12. }
  13. /**
  14. * @param array array of String objects
  15. * @return second element in specified array
  16. */
  17. public static String getSecondElement(String[] array) {
  18. return null;
  19. }
  20. /**
  21. * @param array array of String objects
  22. * @return last element in specified array
  23. */ // TODO
  24. public static String getLastElement(String[] array) {
  25. return null;
  26. }
  27. /**
  28. * @param array array of String objects
  29. * @return second to last element in specified array
  30. */ // TODO
  31. public static String getSecondToLastElement(String[] array) {
  32. return null;
  33. }
  34. /**
  35. * @param array array of String objects
  36. * @param value value to check array for
  37. * @return true if the array contains the specified `value`
  38. */ // TODO
  39. public static boolean contains(String[] array, String value) {
  40. return false;
  41. }
  42. /**
  43. * @param array of String objects
  44. * @return an array with identical contents in reverse order
  45. */ // TODO
  46. public static String[] reverse(String[] array) {
  47. return null;
  48. }
  49. /**
  50. * @param array array of String objects
  51. * @return true if the order of the array is the same backwards and forwards
  52. */ // TODO
  53. public static boolean isPalindromic(String[] array) {
  54. return false;
  55. }
  56. /**
  57. * @param array array of String objects
  58. * @return true if each letter in the alphabet has been used in the array
  59. */ // TODO
  60. public static boolean isPangramic(String[] array) {
  61. return false;
  62. }
  63. /**
  64. * @param array array of String objects
  65. * @param value value to check array for
  66. * @return number of occurrences the specified `value` has occurred
  67. */ // TODO
  68. public static int getNumberOfOccurrences(String[] array, String value) {
  69. return 0;
  70. }
  71. /**
  72. * @param array array of String objects
  73. * @param valueToRemove value to remove from array
  74. * @return array with identical contents excluding values of `value`
  75. */ // TODO
  76. public static String[] removeValue(String[] array, String valueToRemove) {
  77. return null;
  78. }
  79. /**
  80. * @param array array of chars
  81. * @return array of Strings with consecutive duplicates removes
  82. */ // TODO
  83. public static String[] removeConsecutiveDuplicates(String[] array) {
  84. return null;
  85. }
  86. /**
  87. * @param array array of chars
  88. * @return array of Strings with each consecutive duplicate occurrence concatenated as a single string in an array of Strings
  89. */ // TODO
  90. public static String[] packConsecutiveDuplicates(String[] array) {
  91. return null;
  92. }
  93. }